summaryrefslogtreecommitdiff
path: root/django/contrib/admin/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/contrib/admin/forms.py')
-rw-r--r--django/contrib/admin/forms.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/contrib/admin/forms.py b/django/contrib/admin/forms.py
index e790e2e3b6..398af075b1 100644
--- a/django/contrib/admin/forms.py
+++ b/django/contrib/admin/forms.py
@@ -1,9 +1,10 @@
+from __future__ import unicode_literals
+
from django import forms
from django.contrib.auth import authenticate
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.models import User
-
from django.utils.translation import ugettext_lazy, ugettext as _
ERROR_MESSAGE = ugettext_lazy("Please enter the correct username and password "
@@ -25,7 +26,7 @@ class AdminAuthenticationForm(AuthenticationForm):
if username and password:
self.user_cache = authenticate(username=username, password=password)
if self.user_cache is None:
- if u'@' in username:
+ if '@' in username:
# Mistakenly entered e-mail address instead of username? Look it up.
try:
user = User.objects.get(email=username)