Ticket #7263: secure_decorator.patch

File secure_decorator.patch, 1.0 KB (added by Valera Grishin, 16 years ago)

patch

  • decorators.py

     
    8383        if user is None:
    8484            message = ERROR_MESSAGE
    8585            if '@' in username:
    86                 # Mistakenly entered e-mail address instead of username? Look it up.
    87                 users = list(User.objects.filter(email=username))
    88                 if len(users) == 1:
    89                     message = _("Your e-mail address is not your username. Try '%s' instead.") % users[0].username
    90                 else:
    91                     # Either we cannot find the user, or if more than 1
    92                     # we cannot guess which user is the correct one.
    93                     message = _("Usernames cannot contain the '@' character.")
     86                message = _("Usernames cannot contain the '@' character.")
    9487            return _display_login_form(request, message)
    9588
    9689        # The user data is correct; log in the user in and continue.
Back to Top