]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/forms/auth.py
Adding full width and site width banner placeholders. Might be useful while creating...
[osqa.git] / forum / forms / auth.py
index 594e59f8e526de85326df6fe14d2a2a4a6b88b37..cb88ac252dbf2f3ede6f03ad559713f4a8d9405d 100644 (file)
@@ -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']