Project

General

Profile

0003-PasswordResetConfirmView-fix-handling-PasswordChange.patch

Benjamin Renard, 22 September 2022 06:00 PM

Download (1.14 KB)

View differences:

Subject: [PATCH 3/3] PasswordResetConfirmView: fix handling
 PasswordChangeError

 src/authentic2/views.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
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
-