Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored September 14, 2007

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  django/contrib/auth/decorators.py
4  django/contrib/auth/decorators.py
... ...
@@ -1,6 +1,6 @@
1 1
 from django.contrib.auth import REDIRECT_FIELD_NAME
2 2
 from django.http import HttpResponseRedirect
3  
-from urllib import quote
  3
+from django.utils.http import urlquote
4 4
 
5 5
 def user_passes_test(test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME):
6 6
     """
@@ -15,7 +15,7 @@ def _dec(view_func):
15 15
         def _checklogin(request, *args, **kwargs):
16 16
             if test_func(request.user):
17 17
                 return view_func(request, *args, **kwargs)
18  
-            return HttpResponseRedirect('%s?%s=%s' % (login_url, redirect_field_name, quote(request.get_full_path())))
  18
+            return HttpResponseRedirect('%s?%s=%s' % (login_url, redirect_field_name, urlquote(request.get_full_path())))
19 19
         _checklogin.__doc__ = view_func.__doc__
20 20
         _checklogin.__dict__ = view_func.__dict__
21 21
 

0 notes on commit ddd3d7c

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