removed email variables from globals module
This commit is contained in:
parent
50dd725c58
commit
6ae8b541f9
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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']
|
||||
|
Loading…
x
Reference in New Issue
Block a user