Commits

Anonymous committed a5d7fcf Merge

merge fix for #7; thanks Sverre Johansen

Comments (0)

Files changed (2)

 Changelog
 ---------
 
+Tip: (unreleased)
+  * Prevent change_locale view from stripping query params from ``next``.
+    Fixes #7. Thanks Sverre Johansen.
+
 Release 1.4: (2010-03-19)
   * Moved localeurl settings from localeurl/__init__.py to
     localeurl/settings.py.  

localeurl/views.py

     """
     next = request.REQUEST.get('next', None)
     if not next:
-        next = request.META.get('HTTP_REFERER', None)
+        next = urlsplit(request.META.get('HTTP_REFERER', None))[2]
     if not next:
         next = '/'
-    next = urlsplit(next).path
     _, path = utils.strip_path(next)
     if request.method == 'POST':
         locale = request.POST.get('locale', None)