From 0d2bbe54e905e0c09912a2111bc0f4650f193707 Mon Sep 17 00:00:00 2001 From: Bill Fenner Date: Tue, 12 Jun 2007 18:50:41 +0000 Subject: [PATCH] Pass through remaining query arguments. - Legacy-Id: 342 --- ietf/redirects/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ietf/redirects/views.py b/ietf/redirects/views.py index 3d19c6b76..3e67f0932 100644 --- a/ietf/redirects/views.py +++ b/ietf/redirects/views.py @@ -33,4 +33,11 @@ def redirect(request, path="", script=""): url = re.sub(r'/+', '/', url) if remove: url = re.sub(re.escape(remove) + "/?$", "", url) + # Copy the GET arguments, remove all the ones we were + # expecting and if there are any left, add them to the URL. + get = request.GET.copy() + for arg in re.findall(r'%\(([^)]+)\)', rest): + get.pop(arg) + if get: + url += '?' + get.urlencode() return HttpResponseRedirect(url)