changeset 1924:2f923072f62b

fix traceback when email not configured
author Roger Haase <crosseyedpenguin@yahoo.com>
date Thu, 24 Jan 2013 09:13:15 -0700
parents aad93e28d9d6
children b992bfbf70ae
files MoinMoin/mail/sendmail.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/mail/sendmail.py	Thu Jan 24 09:12:11 2013 -0700
+++ b/MoinMoin/mail/sendmail.py	Thu Jan 24 09:13:15 2013 -0700
@@ -85,6 +85,8 @@
     from email.Utils import formatdate, make_msgid
 
     cfg = app.cfg
+    if not cfg.mail_enabled:
+        return (0, _("Contact administrator: cannot send password recovery e-mail because mail configuration is incomplete."))
     mail_from = mail_from or cfg.mail_from
 
     logging.debug("send mail, from: {0!r}, subj: {1!r}".format(mail_from, subject))