]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/utils/mail.py
Tries to eliminate a possible race condition when a user who is trying to ask a quest...
[osqa.git] / forum / utils / mail.py
index b118d6ff0dad74ac2163e1c3f326e45838b05aa7..8f6ee50226d19481d6a6ab37931efa5132fbf89d 100644 (file)
@@ -140,6 +140,9 @@ def send_template_email(recipients, template, context):
     t.render(Context(context))
 
 def create_and_send_mail_messages(messages):
     t.render(Context(context))
 
 def create_and_send_mail_messages(messages):
+    if not settings.EMAIL_HOST:
+        return
+
     sender = Header(unicode(settings.APP_SHORT_NAME), 'utf-8')
     sender.append('<%s>' % unicode(settings.DEFAULT_FROM_EMAIL))
     sender = u'%s <%s>' % (unicode(settings.APP_SHORT_NAME), unicode(settings.DEFAULT_FROM_EMAIL))
     sender = Header(unicode(settings.APP_SHORT_NAME), 'utf-8')
     sender.append('<%s>' % unicode(settings.DEFAULT_FROM_EMAIL))
     sender = u'%s <%s>' % (unicode(settings.APP_SHORT_NAME), unicode(settings.DEFAULT_FROM_EMAIL))