Ticket #6306: 6306.diff

File 6306.diff, 1.1 KB (added by Chris Beaven, 17 years ago)
  • django/contrib/auth/views.py

     
    88from django.contrib.auth.decorators import login_required
    99from django.contrib.auth import REDIRECT_FIELD_NAME
    1010from django.utils.translation import ugettext as _
     11from django.utils.http import urlquote
    1112
    1213def login(request, template_name='registration/login.html', redirect_field_name=REDIRECT_FIELD_NAME):
    1314    "Displays the login form and handles the login action."
     
    6162    if not login_url:
    6263        from django.conf import settings
    6364        login_url = settings.LOGIN_URL
    64     return HttpResponseRedirect('%s?%s=%s' % (login_url, redirect_field_name, next))
     65    return HttpResponseRedirect('%s?%s=%s' % (login_url, urlquote(redirect_field_name), urlquote(next)))
    6566
    6667def password_reset(request, is_admin_site=False, template_name='registration/password_reset_form.html',
    6768        email_template_name='registration/password_reset_email.html'):
Back to Top