Files
@ 808a70eb093c
Branch filter:
Location: CopyleftConf/copyleftconf-website/pinaxcon/account_hooks.py - annotation
808a70eb093c
742 B
text/x-python
Revert "Hide Rego"
This reverts commit 70498db51bab734952b3c4b8733e664cf370051c.
Revert "Comment out ticket sales message"
This reverts commit c012168d45f5d430329a3ce9dd46f14d808cf140.
This reverts commit 70498db51bab734952b3c4b8733e664cf370051c.
Revert "Comment out ticket sales message"
This reverts commit c012168d45f5d430329a3ce9dd46f14d808cf140.
0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 0487525f5c26 | from account import hooks
from django.contrib.auth.models import User
class BetterAccountHookSet(hooks.AccountDefaultHookSet):
def get_user_credentials(self, form, identifier_field):
username = form.cleaned_data[identifier_field]
# Find an actual username so we can authenticate
print username,
if identifier_field == "email":
username = self.get_username_by_email(username)
print username,
return {
"username": username,
"password": form.cleaned_data["password"],
}
def get_username_by_email(self, email):
try:
return User.objects.get(email=email).username
except User.DoesNotExist:
return None
|