From b6301e466065baa3720d40a23d3f6da33c969f06 Mon Sep 17 00:00:00 2001 From: Bill Fenner Date: Thu, 6 Sep 2007 15:12:33 +0000 Subject: [PATCH] Based on Nico Williams' case-sensitive email problem, make sure that usernames and emails are compared ignoring case when logging in. - Legacy-Id: 925 --- ietf/bin/import-users | 2 +- ietf/ietfauth/auth.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ietf/bin/import-users b/ietf/bin/import-users index f6246cd2b..86d219dff 100755 --- a/ietf/bin/import-users +++ b/ietf/bin/import-users @@ -94,7 +94,7 @@ while line != '': t = user if add: t += "%d" % ( add ) - u = User.objects.get(username = t) + u = User.objects.get(username__iexact = t) except User.DoesNotExist: u = None user = t diff --git a/ietf/ietfauth/auth.py b/ietf/ietfauth/auth.py index b6417a483..e5d0a2334 100644 --- a/ietf/ietfauth/auth.py +++ b/ietf/ietfauth/auth.py @@ -27,9 +27,9 @@ class EmailBackend(ModelBackend): def authenticate(self, username=None, password=None): try: if email_re.search(username): - user = User.objects.get(email=username) + user = User.objects.get(email__iexact=username) else: - user = User.objects.get(username=username) + user = User.objects.get(username__iexact=username) except User.DoesNotExist: return None if crypt_check_password(user, password):