removed email variables from globals module
authorDeb <deb@eximiousproductions.com>
Wed, 13 Jul 2011 01:21:35 +0000 (21:21 -0400)
committerDeb <deb@eximiousproductions.com>
Wed, 13 Jul 2011 01:21:35 +0000 (21:21 -0400)
mediagoblin/app.py
mediagoblin/auth/lib.py
mediagoblin/mg_globals.py
mediagoblin/util.py

index ae39694fb86bc71ff68c1b01e715b577de2cd773..147db09c42c4b7f4e6da511cace6a974121cdb02 100644 (file)
@@ -93,12 +93,6 @@ class MediaGoblinApp(object):
         #######################################################
 
         setup_globals(
-            # TODO: No need to set these two up as globals, we could
-            # just read them out of mg_globals.app_config
-            email_sender_address=app_config['email_sender_address'],
-            email_debug_mode=app_config['email_debug_mode'],
-
-            # Actual, useful to everyone objects
             app=self,
             db_connection=self.connection,
             database=self.db,
index 08bbdd161e5ffaca458859086a46adf612129899..6d1aec49cf13c94cea48d6703e3f4a6e6afdd174 100644 (file)
@@ -112,7 +112,7 @@ def send_verification_email(user, request):
 
     # TODO: There is no error handling in place
     send_email(
-        mg_globals.email_sender_address,
+        mg_globals.app_config['email_sender_address'],
         [user['email']],
         # TODO
         # Due to the distributed nature of GNU MediaGoblin, we should
index 739f44eed512c512a731470e7a03788a7bc3c70c..12a0e016b99e46384d6dbf0d009f7862fde37d3d 100644 (file)
@@ -20,12 +20,6 @@ database = None
 public_store = None
 queue_store = None
 
-# Dump mail to stdout instead of sending it:
-email_debug_mode = False
-
-# Address for sending out mails
-email_sender_address = None
-
 # A WorkBenchManager
 workbench_manager = None
 
index 7b1e4a2a7c36535aeb6a484965b8b338cf31ab9e..9c4d024a533ef6fd532340aaaea68f37fc3cfbcb 100644 (file)
@@ -265,9 +265,9 @@ def send_email(from_addr, to_addrs, subject, message_body):
      - message_body: email body text
     """
     # TODO: make a mock mhost if testing is enabled
-    if TESTS_ENABLED or mg_globals.email_debug_mode:
+    if TESTS_ENABLED or mg_globals.app_config['email_debug_mode']:
         mhost = FakeMhost()
-    elif not mg_globals.email_debug_mode:
+    elif not mg_globals.app_config['email_debug_mode']:
         mhost = smtplib.SMTP()
 
     mhost.connect()
@@ -280,7 +280,7 @@ def send_email(from_addr, to_addrs, subject, message_body):
     if TESTS_ENABLED:
         EMAIL_TEST_INBOX.append(message)
 
-    if getattr(mg_globals, 'email_debug_mode', False):
+    if mg_globals.app_config['email_debug_mode']:
         print u"===== Email ====="
         print u"From address: %s" % message['From']
         print u"To addresses: %s" % message['To']