Ticket #6943: 6943-admin-multiple-emails.diff

File 6943-admin-multiple-emails.diff, 732 bytes (added by Michael Newman, 17 years ago)

simple two line patch to catch the exception and return a generic message

  • django/contrib/admin/sites.py

     
    228228                    user = User.objects.get(email=username)
    229229                except User.DoesNotExist:
    230230                    message = _("Usernames cannot contain the '@' character.")
     231                except User.MultipleObjectsReturned:
     232                    message = _("Your e-mail address is not your username")
    231233                else:
    232234                    message = _("Your e-mail address is not your username. Try '%s' instead.") % user.username
    233235            return _display_login_form(request, message)
Back to Top