Commits

Thomas Waldmann committed ed73c69

set_password: only check email if notify was requested, fix id KeyError

  • Participants
  • Parent commits 2e205b7

Comments (0)

Files changed (1)

MoinMoin/script/account/resetpw.py

             return
         u.set_password(password)
         u.save()
-        if not u.email:
-            raise UserHasNoEMail('User profile does not have an E-Mail address (name: %r id: %r)!' % (u.name, u.id))
         if notify and not u.disabled:
+            if not u.email:
+                raise UserHasNoEMail('Notification was requested, but User profile does not have a validated E-Mail address (name: %r id: %r)!' % (u.name, u.itemid))
             mailok, msg = u.mail_password_recovery(subject=subject, text=text)
             if not mailok:
                 raise MailFailed(msg)