From 0c85192ebeb374e7a7ad8e72ebecdf173d7fdcce Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Tue, 7 Apr 2009 19:50:42 +0000 Subject: [1.0.X] Fixed #10585: comment redirects built from the `next` parameter now work correctly when `next` already contains a query string. Backport of r10424 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10425 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/comments/views/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'django') diff --git a/django/contrib/comments/views/utils.py b/django/contrib/comments/views/utils.py index a37c555e78..c5c900d47f 100644 --- a/django/contrib/comments/views/utils.py +++ b/django/contrib/comments/views/utils.py @@ -25,7 +25,8 @@ def next_redirect(data, default, default_view, **get_kwargs): if next is None: next = urlresolvers.reverse(default_view) if get_kwargs: - next += "?" + urllib.urlencode(get_kwargs) + joiner = ('?' in next) and '&' or '?' + next += joiner + urllib.urlencode(get_kwargs) return HttpResponseRedirect(next) def confirmation_view(template, doc="Display a confirmation view."): -- cgit v1.3