mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 19:46:46 +00:00
(cherry picked from commit fe68598c1b4aa8ba5c4710a195054048baff7306) Co-authored-by: Firas Ben Mefteh <ben.meft0@gmail.com>
This commit is contained in:
parent
f5a36ce44e
commit
aaabce9873
@ -161,6 +161,7 @@ class SetPasswordForm(HelperForm):
|
|||||||
old_password = forms.CharField(
|
old_password = forms.CharField(
|
||||||
label=_("Old password"),
|
label=_("Old password"),
|
||||||
strip=False,
|
strip=False,
|
||||||
|
required=False,
|
||||||
widget=forms.PasswordInput(attrs={'autocomplete': 'current-password', 'autofocus': True}),
|
widget=forms.PasswordInput(attrs={'autocomplete': 'current-password', 'autofocus': True}),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -447,8 +447,7 @@ class SetPasswordView(AjaxUpdateView):
|
|||||||
|
|
||||||
if valid:
|
if valid:
|
||||||
# Old password must be correct
|
# Old password must be correct
|
||||||
|
if user.has_usable_password() and not user.check_password(old_password):
|
||||||
if not user.check_password(old_password):
|
|
||||||
form.add_error('old_password', _('Wrong password provided'))
|
form.add_error('old_password', _('Wrong password provided'))
|
||||||
valid = False
|
valid = False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user