From: Christopher Allan Webber Date: Thu, 12 May 2011 19:49:37 +0000 (-0500) Subject: Fix the email debug inbox X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=21919313dfc18c9f9303cbbb2591c0410379f768;p=mediagoblin.git Fix the email debug inbox --- diff --git a/mediagoblin/util.py b/mediagoblin/util.py index 63f0f9c5..946216ba 100644 --- a/mediagoblin/util.py +++ b/mediagoblin/util.py @@ -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())