Revision 789a5951 snf-astakos-app/astakos/im/auth_backends.py
b/snf-astakos-app/astakos/im/auth_backends.py | ||
---|---|---|
48 | 48 |
""" |
49 | 49 |
def authenticate(self, email=None, auth_token=None): |
50 | 50 |
try: |
51 |
user = AstakosUser.objects.get(email=email, is_active=True) |
|
51 |
user = AstakosUser.objects.get(email__iexact=email, is_active=True)
|
|
52 | 52 |
if user.auth_token == auth_token: |
53 | 53 |
return user |
54 | 54 |
except AstakosUser.DoesNotExist: |
... | ... | |
74 | 74 |
def authenticate(self, username=None, password=None): |
75 | 75 |
#If username is an email address, then try to pull it up |
76 | 76 |
if email_re.search(username): |
77 |
users = AstakosUser.objects.filter(email=username) |
|
77 |
users = AstakosUser.objects.filter(email__iexact=username)
|
|
78 | 78 |
if not users: |
79 | 79 |
return None |
80 | 80 |
for user in users: |
Also available in: Unified diff