Another change related to permitting '@' in the usernames.

- Legacy-Id: 2057
This commit is contained in:
Henrik Levkowetz 2010-03-11 13:35:20 +00:00
parent b9f824c9e5
commit 6b1e2462cb

View file

@ -305,13 +305,13 @@ class AdminSite(object):
try:
user = User.objects.get(email=username)
except (User.DoesNotExist, User.MultipleObjectsReturned):
message = _("Usernames cannot contain the '@' character.")
pass
else:
if user.check_password(password):
message = _("Your e-mail address is not your username."
" Try '%s' instead.") % user.username
else:
message = _("Usernames cannot contain the '@' character.")
pass
return self.display_login_form(request, message)
# The user data is correct; log in the user in and continue.