Add exception message when user modify password same as previous

When user change password same as previous password,then user get
an error message "Unable to change password" on Horizon which
does not specify the clear reason why it cannot be change.
This patch corrects the exception raised.

Change-Id: I95acf5c579fd213d64f111010c31fe6c5a0991af
Closes-Bug: #1820102
This commit is contained in:
manchandavishal 2019-04-09 08:40:44 +00:00
parent d6cb98529a
commit 1ac40ea95f

View File

@ -69,9 +69,9 @@ class PasswordForm(forms.SelfHandlingForm):
msg = _("Password changed. Please log in again to continue.") msg = _("Password changed. Please log in again to continue.")
utils.add_logout_reason(request, response, msg) utils.add_logout_reason(request, response, msg)
return response return response
except Exception: except Exception as ex:
exceptions.handle(request, exceptions.handle(request,
_('Unable to change password.')) _('Unable to change password: %s') % ex)
return False return False
else: else:
messages.error(request, _('Changing password is not supported.')) messages.error(request, _('Changing password is not supported.'))