summaryrefslogtreecommitdiff
path: root/chimere/main
diff options
context:
space:
mode:
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
commitf1f3725d615a51b26b9928a21930939283713472 (patch)
tree16262ca7b62c727cf520c3f2cec4f3a116cebdba /chimere/main
parent128a0f653640602a51e0d59b7cb5bad088d98c15 (diff)
downloadChimère-1.0.0.tar.bz2
Chimère-1.0.0.zip
Manage an application with no email server setv1.0.0
Diffstat (limited to 'chimere/main')
-rw-r--r--chimere/main/actions.py10
-rw-r--r--chimere/main/forms.py2
-rw-r--r--chimere/main/models.py1
3 files changed, 7 insertions, 6 deletions
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)