diff -rupN admin/media/css/login.css /home/kyle/django/contrib/admin/media/css/login.css --- admin/media/css/login.css 2009-01-29 22:05:47.000000000 -0700 +++ /home/kyle/django/contrib/admin/media/css/login.css 2009-01-08 22:05:47.000000000 -0700 @@ -8,6 +8,6 @@ body.login { background:#eee; } .login form { margin-top:1em; } .login .form-row { padding:4px 0; float:left; width:100%; } .login .form-row label { float:left; width:9em; padding-right:0.5em; line-height:2em; text-align:right; font-size:1em; color:#333; } -.login .form-row #id_username, .login .form-row #id_password { width:14em; } +.login .form-row #id_email, .login .form-row #id_password { width:14em; } .login span.help { font-size:10px; display:block; } -.login .submit-row { clear:both; padding:1em 0 0 9.4em; } \ No newline at end of file +.login .submit-row { clear:both; padding:1em 0 0 9.4em; } diff -rupN admin/sites.py /home/kyle/django/contrib/admin/sites.py --- admin/sites.py 2009-01-29 22:05:47.000000000 -0700 +++ /home/kyle/django/contrib/admin/sites.py 2009-01-08 22:05:47.000000000 -0700 @@ -13,7 +13,7 @@ from django.views.decorators.cache impor from django.conf import settings from django.utils.hashcompat import md5_constructor -ERROR_MESSAGE = ugettext_lazy("Please enter a correct username and password. Note that both fields are case-sensitive.") +ERROR_MESSAGE = ugettext_lazy("Please enter a correct email and password. Note that both fields are case-sensitive.") LOGIN_FORM_KEY = 'this_is_the_login_form' class AlreadyRegistered(Exception): @@ -237,23 +237,11 @@ class AdminSite(object): request.session.delete_test_cookie() # Check the password. - username = request.POST.get('username', None) + email = request.POST.get('email', None) password = request.POST.get('password', None) - user = authenticate(username=username, password=password) + user = authenticate(email=email, password=password) if user is None: message = ERROR_MESSAGE - if u'@' in username: - # Mistakenly entered e-mail address instead of username? Look it up. - try: - user = User.objects.get(email=username) - except (User.DoesNotExist, User.MultipleObjectsReturned): - message = _("Usernames cannot contain the '@' character.") - 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.") return self.display_login_form(request, message) # The user data is correct; log in the user in and continue. diff -rupN admin/templates/admin/auth/user/add_form.html /home/kyle/django/contrib/admin/templates/admin/auth/user/add_form.html --- admin/templates/admin/auth/user/add_form.html 2009-01-29 22:05:47.000000000 -0700 +++ /home/kyle/django/contrib/admin/templates/admin/auth/user/add_form.html 2009-01-08 22:05:47.000000000 -0700 @@ -3,15 +3,15 @@ {% block after_field_sets %} -
{% trans "First, enter a username and password. Then, you'll be able to edit more user options." %}
+{% trans "First, enter a email and password. Then, you'll be able to edit more user options." %}
{% endblock %} diff -rupN admin/templates/admin/auth/user/change_password.html /home/kyle/django/contrib/admin/templates/admin/auth/user/change_password.html --- admin/templates/admin/auth/user/change_password.html 2009-01-29 22:05:47.000000000 -0700 +++ /home/kyle/django/contrib/admin/templates/admin/auth/user/change_password.html 2009-01-08 22:05:47.000000000 -0700 @@ -23,7 +23,7 @@ {% endif %} -{% blocktrans with original.username|escape as username %}Enter a new password for the user {{ username }}.{% endblocktrans %}
+{% blocktrans with original.email|escape as email %}Enter a new password for the user {{ email }}.{% endblocktrans %}