Skip to content
Snippets Groups Projects
Commit 2caebf41 authored by Martin Burchell's avatar Martin Burchell
Browse files

Fixed handling of password reset for unknown email

parent be4f6bb8
No related branches found
No related tags found
1 merge request!49Password reset
......@@ -166,10 +166,10 @@ class ContactPasswordResetForm(PasswordResetForm):
self.users_cache = UserModel._default_manager.filter(
business_email__iexact=email)
if not len(self.users_cache):
raise ValidationError(self.error_messages['unknown'])
raise ValidationError("User with email '%s' not known" % email)
if not any(user.is_active for user in self.users_cache):
# none of the filtered users are active
raise ValidationError(self.error_messages['unknown'])
raise ValidationError("User with email '%s' not known" % email)
return email
def save(self, subject,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment