Skip to content
Browse files

Fix account.forms.LoginForm.is_valid method that would break if EMAIL…

…_AUTHENTICATION was set to true
  • Loading branch information...
1 parent ef8961f commit cd709d5f40e552e341bc3b11659e11e85a41aff9 @nduthoit nduthoit committed Jan 17, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 pinax/apps/account/forms.py
View
6 pinax/apps/account/forms.py
@@ -101,7 +101,11 @@ def clean(self):
def is_valid(self, *args, **kwargs):
result = super(LoginForm, self).is_valid(*args, **kwargs)
- user_login_attempt.send(sender=LoginForm, username=self.data["username"], result=result)
+ if EMAIL_AUTHENTICATION:
+ username = self.data["email"]
+ else:
+ username = self.data["username"]
+ user_login_attempt.send(sender=LoginForm, username=username, result=result)
return result
def login(self, request):

0 comments on commit cd709d5

Please sign in to comment.
Something went wrong with that request. Please try again.