aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tools/mail.py
diff options
context:
space:
mode:
authorRodney Ewing <ewing.rj@gmail.com>2013-05-28 10:46:46 -0700
committerRodney Ewing <ewing.rj@gmail.com>2013-05-28 10:46:46 -0700
commit8087f56b07b11a8abc1f6d5108a70765712cc63d (patch)
tree7002a38f819f8ccfc505494c9eb6d6d0ed388f33 /mediagoblin/tools/mail.py
parent377db0e7ffdca6ce56041d28eba536ecd3b2a58a (diff)
parentf9e032212dff4d54de644cb5537bc0bef6d24c7f (diff)
downloadmediagoblin-8087f56b07b11a8abc1f6d5108a70765712cc63d.tar.lz
mediagoblin-8087f56b07b11a8abc1f6d5108a70765712cc63d.tar.xz
mediagoblin-8087f56b07b11a8abc1f6d5108a70765712cc63d.zip
Merge remote-tracking branch 'upstream/master' into change_email
Conflicts: mediagoblin/auth/lib.py
Diffstat (limited to 'mediagoblin/tools/mail.py')
-rw-r--r--mediagoblin/tools/mail.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/mediagoblin/tools/mail.py b/mediagoblin/tools/mail.py
index 4fa02ce5..6886c859 100644
--- a/mediagoblin/tools/mail.py
+++ b/mediagoblin/tools/mail.py
@@ -16,7 +16,7 @@
import smtplib
from email.MIMEText import MIMEText
-from mediagoblin import mg_globals
+from mediagoblin import mg_globals, messages
from mediagoblin.tools import common
### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -135,3 +135,16 @@ def normalize_email(email):
return None
email = "@".join((em_user, em_dom.lower()))
return email
+
+
+def email_debug_message(request):
+ """
+ If the server is running in email debug mode (which is
+ the current default), give a debug message to the user
+ so that they have an idea where to find their email.
+ """
+ if mg_globals.app_config['email_debug_mode']:
+ # DEBUG message, no need to translate
+ messages.add_message(request, messages.DEBUG,
+ u"This instance is running in email debug mode. "
+ u"The email will be on the console of the server process.")