Fix the email debug inbox
authorChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 12 May 2011 19:49:37 +0000 (14:49 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 12 May 2011 19:51:45 +0000 (14:51 -0500)
mediagoblin/util.py

index 63f0f9c5045c37cd2074781a2bd19b852e2e4671..946216bae80175f20fb2f4510fc76dd2284ba54d 100644 (file)
@@ -172,7 +172,7 @@ def send_email(from_addr, to_addrs, subject, message_body):
     if TESTS_ENABLED:
         EMAIL_TEST_INBOX.append(message)
 
-    elif mgoblin_globals.email_debug_mode:
+    if getattr(mgoblin_globals, 'email_debug_mode', False):
         print u"===== Email ====="
         print u"From address: %s" % message['From']
         print u"To addresses: %s" % message['To']
@@ -180,6 +180,4 @@ def send_email(from_addr, to_addrs, subject, message_body):
         print u"-- Body: --"
         print message.get_payload(decode=True)
 
-    else:
-        return mhost.sendmail(from_addr, to_addrs, message.as_string())
-
+    return mhost.sendmail(from_addr, to_addrs, message.as_string())