diff MoinMoin/user.py @ 5929:8d03f3ec97a7

don't try to send email to user if email address in profile is empty
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 21 Jan 2013 17:26:37 +0100
parents 25900eaeb864
children aac944a51a54
line wrap: on
line diff
--- a/MoinMoin/user.py	Mon Jan 21 16:24:06 2013 +0100
+++ b/MoinMoin/user.py	Mon Jan 21 17:26:37 2013 +0100
@@ -203,7 +203,7 @@
         else:
             u.enc_password = encodePassword(request.cfg, newpass)
         u.save()
-        if notify and not u.disabled and u.email:
+        if notify and not u.disabled:
             mailok, msg = u.mailAccountData()
             if not mailok:
                 raise MailFailed(msg)
@@ -1119,6 +1119,9 @@
         from MoinMoin.wikiutil import getLocalizedPage
         _ = self._request.getText
 
+        if not self.email:
+            return False, "user has no E-Mail address in his profile."
+
         tok = self.generate_recovery_token()
 
         text = '\n' + _("""\