changeset 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 d97e3b0d6b49
children aac944a51a54
files MoinMoin/user.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
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' + _("""\