diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2010-11-13 01:56:39 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2010-11-13 01:56:39 +0100 |
commit | f1f3725d615a51b26b9928a21930939283713472 (patch) | |
tree | 16262ca7b62c727cf520c3f2cec4f3a116cebdba | |
parent | 128a0f653640602a51e0d59b7cb5bad088d98c15 (diff) | |
download | Chimère-f1f3725d615a51b26b9928a21930939283713472.tar.bz2 Chimère-f1f3725d615a51b26b9928a21930939283713472.zip |
Manage an application with no email server setv1.0.0
-rw-r--r-- | chimere/.gitignore | 3 | ||||
-rw-r--r-- | chimere/main/actions.py | 10 | ||||
-rw-r--r-- | chimere/main/forms.py | 2 | ||||
-rw-r--r-- | chimere/main/models.py | 1 | ||||
-rw-r--r-- | chimere/urls.py | 2 |
5 files changed, 11 insertions, 7 deletions
diff --git a/chimere/.gitignore b/chimere/.gitignore index dc3d5e7..282a255 100644 --- a/chimere/.gitignore +++ b/chimere/.gitignore @@ -1,2 +1,5 @@ settings.py *.pyc +*.swp +static/icons/* +static/upload/* diff --git a/chimere/main/actions.py b/chimere/main/actions.py index 4857005..f86e954 100644 --- a/chimere/main/actions.py +++ b/chimere/main/actions.py @@ -23,16 +23,16 @@ Actions available in the main interface from django.utils.translation import ugettext_lazy as _ from django.contrib.auth import models -from chimere.settings import EXTRA_URL +from chimere.settings import EXTRA_URL, EMAIL_HOST class Action: def __init__(self, id, path, label): self.id, self.path, self.label = id, path, label -actions = ((Action('view', '', _('View')), []), +actions = [(Action('view', '', _('View')), []), (Action('contribute', 'edit', _('Contribute')), (Action('edit', 'edit', _('Add a new point of interest')), Action('edit_route', 'edit_route', _('Add a new route'))) - ), - (Action('contact', 'contact', _('Contact us')), []), - ) + ),] +if EMAIL_HOST: + actions.append((Action('contact', 'contact', _('Contact us')), []),) diff --git a/chimere/main/forms.py b/chimere/main/forms.py index 4618321..f2490da 100644 --- a/chimere/main/forms.py +++ b/chimere/main/forms.py @@ -33,6 +33,8 @@ from chimere.main.models import Marker, Route, PropertyModel, Property, Area,\ from chimere.main.widgets import AreaField, PointField, TextareaWidget def notifyStaff(subject, body, sender=None): + if not settings.EMAIL_HOST: + return if settings.PROJECT_NAME: subject = u'[%s] %s' % (settings.PROJECT_NAME, subject) user_list = [u.email for u in diff --git a/chimere/main/models.py b/chimere/main/models.py index 4ef4c0d..3efc1bc 100644 --- a/chimere/main/models.py +++ b/chimere/main/models.py @@ -155,7 +155,6 @@ class SubCategory(models.Model): subcategories ''' sub_categories = {} - subcategories = None subcategories = cls.objects.filter(category__available=True) if not item_types: subcategories = subcategories.filter(available=True) diff --git a/chimere/urls.py b/chimere/urls.py index 9652eb6..b94cd6f 100644 --- a/chimere/urls.py +++ b/chimere/urls.py @@ -71,7 +71,7 @@ urlpatterns += patterns('chimere.main.views', 'getDescriptionDetail', default_dct), (base + extra + r'getGeoObjects/(?P<category_ids>\w+)(/(?P<status>\w+))?$', 'getGeoObjects', default_dct), -(base + extra + r'getAvailableCategories/(?P<area>\w+)(/(?P<status>\w+))?(/(?P<force>\w+))?$', +(base + extra + r'getAvailableCategories/((?P<area>\w+))?(/(?P<status>\w+))?(/(?P<force>\w+))?$', 'getAvailableCategories', default_dct), (base + extra + r'getTinyUrl/(?P<parameters>.*)$', 'getTinyfiedUrl', default_dct), (base + extra + r'ty/(?P<tiny_urn>\w+)$', 'redirectFromTinyURN', default_dct), |