Forgot password form should not validate if user has not confirmed their email address yet. Fixes #298

This commit is contained in:
Matt Wright
2014-09-17 11:21:31 -04:00
parent 3a0af73231
commit 3d7b97ac31
2 changed files with 20 additions and 0 deletions
+8
View File
@@ -175,6 +175,14 @@ class ForgotPasswordForm(Form, UserEmailFormMixin):
submit = SubmitField(get_form_field_label('recover_password'))
def validate(self):
if not super(ForgotPasswordForm, self).validate():
return False
if requires_confirmation(self.user):
self.email.errors.append(get_message('CONFIRMATION_REQUIRED')[0])
return False
return True
class PasswordlessLoginForm(Form, UserEmailFormMixin):
"""The passwordless login form"""