mirror of
https://github.com/wassname/flask-security.git
synced 2026-08-11 11:18:40 +08:00
Fix change password form
This commit is contained in:
@@ -200,8 +200,8 @@ class ResetPasswordForm(Form, NewPasswordFormMixin, PasswordConfirmFormMixin):
|
||||
submit = SubmitField("Reset Password")
|
||||
|
||||
|
||||
class ChangePasswordForm(Form, PasswordFormMixin):
|
||||
"""The default Change password form"""
|
||||
class ChangePasswordForm(Form, NextFormMixin, PasswordFormMixin):
|
||||
"""The default change password form"""
|
||||
|
||||
new_password = PasswordField("New Password",
|
||||
validators=[password_required,
|
||||
@@ -213,7 +213,8 @@ class ChangePasswordForm(Form, PasswordFormMixin):
|
||||
submit = SubmitField("Change Password")
|
||||
|
||||
def validate(self):
|
||||
super(ChangePasswordForm, self).validate()
|
||||
if not super(ChangePasswordForm, self).validate():
|
||||
return False
|
||||
|
||||
if self.password.data.strip() == '':
|
||||
self.password.errors.append('Password not provided')
|
||||
|
||||
Reference in New Issue
Block a user