Index: django/contrib/admin/views/decorators.py
===================================================================
--- django/contrib/admin/views/decorators.py	(revision 7540)
+++ django/contrib/admin/views/decorators.py	(working copy)
@@ -84,13 +84,14 @@
             message = ERROR_MESSAGE
             if '@' in username:
                 # Mistakenly entered e-mail address instead of username? Look it up.
-                users = list(User.objects.filter(email=username))
-                if len(users) == 1:
-                    message = _("Your e-mail address is not your username. Try '%s' instead.") % users[0].username
-                else:
+                try:
+                    user = User.objects.get(email=username)
+                except (User.DoesNotExist, User.MultipleObjectsReturned):
                     # Either we cannot find the user, or if more than 1 
                     # we cannot guess which user is the correct one.
                     message = _("Usernames cannot contain the '@' character.")
+                else:
+                    message = _("Your e-mail address is not your username. Try '%s' instead.") % user.username
             return _display_login_form(request, message)
 
         # The user data is correct; log in the user in and continue.
