0003-PasswordResetConfirmView-fix-handling-PasswordChange.patch
src/authentic2/views.py | ||
---|---|---|
994 | 994 |
def form_valid(self, form): |
995 | 995 |
# Changing password by mail validate the email |
996 | 996 |
form.user.set_email_verified(True) |
997 |
form.save() |
|
997 |
try: |
|
998 |
form.save() |
|
999 |
except utils_misc.PasswordChangeError as e: |
|
1000 |
form.add_error('new_password1', e.message) |
|
1001 |
return self.form_invalid(form) |
|
998 | 1002 |
hooks.call_hooks('event', name='password-reset-confirm', user=form.user, token=self.token, form=form) |
999 | 1003 |
logger.info('password reset for user %s with token %r', self.user, self.token.uuid) |
1000 | 1004 |
self.token.delete() |
1001 |
- |