Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #5308 -- Redirect from pages that need login and have Unicode U…

…RL no longer causes error. Thanks, webjunkie

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6226 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit ddd3d7c71fb25e3685f17b6a231addf143e2741b 1 parent dd79959
Adrian Holovaty adrianholovaty authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/contrib/auth/decorators.py
4 django/contrib/auth/decorators.py
View
@@ -1,6 +1,6 @@
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.http import HttpResponseRedirect
-from urllib import quote
+from django.utils.http import urlquote
def user_passes_test(test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME):
"""
@@ -15,7 +15,7 @@ def _dec(view_func):
def _checklogin(request, *args, **kwargs):
if test_func(request.user):
return view_func(request, *args, **kwargs)
- return HttpResponseRedirect('%s?%s=%s' % (login_url, redirect_field_name, quote(request.get_full_path())))
+ return HttpResponseRedirect('%s?%s=%s' % (login_url, redirect_field_name, urlquote(request.get_full_path())))
_checklogin.__doc__ = view_func.__doc__
_checklogin.__dict__ = view_func.__dict__
Please sign in to comment.
Something went wrong with that request. Please try again.