Skip to content
Browse files

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

…RL no longer causes error. Thanks, webjunkie

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent dd79959 commit ddd3d7c71fb25e3685f17b6a231addf143e2741b @adrianholovaty adrianholovaty committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/contrib/auth/
4 django/contrib/auth/
@@ -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__

0 comments on commit ddd3d7c

Please sign in to comment.
Something went wrong with that request. Please try again.