X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/9308d78c7f1e4d2a4faf3b98d1b24c262f3b6287..522d4762eb1aaba30d4de9275dbea9b83e3e7227:/forum/forms/auth.py?ds=sidebyside diff --git a/forum/forms/auth.py b/forum/forms/auth.py index 594e59f..cb88ac2 100644 --- a/forum/forms/auth.py +++ b/forum/forms/auth.py @@ -26,12 +26,12 @@ class TemporaryLoginRequestForm(forms.Form): ) def clean_email(self): - try: - user = User.objects.get(email=self.cleaned_data['email']) - except: + users = list(User.objects.filter(email=self.cleaned_data['email'])) + + if not len(users): raise forms.ValidationError(_("Sorry, but this email is not on our database.")) - self.user_cache = user + self.user_cache = users return self.cleaned_data['email']