Permalink
Browse files

when ACCOUNT_EMAIL_VERIFICATION is False, allow a password reset even…

… when the email is not verified
  • Loading branch information...
1 parent a9c6ab1 commit 45d3b04f4d7a33bbffe28da4c40de353c14b271a @jasonculverhouse jasonculverhouse committed Jun 14, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 allauth/account/forms.py
View
@@ -367,7 +367,12 @@ class ResetPasswordForm(forms.Form):
)
def clean_email(self):
- if EmailAddress.objects.filter(email__iexact=self.cleaned_data["email"], verified=True).count() == 0:
+ query = EmailAddress.objects.filter(email__iexact=self.cleaned_data["email"])
+ if EMAIL_VERIFICATION:
+ # only allow password reset for for verified users when
+ # EMAIL_VERIFICATION is require to activate account
+ query =query.filter(verified=True)
+ if query.count() == 0:
raise forms.ValidationError(_("E-mail address not verified for any user account"))
return self.cleaned_data["email"]

0 comments on commit 45d3b04

Please sign in to comment.