- additional_get_params = urllib.urlencode(request.GET)
- return HttpResponseRedirect(forward + "?%s" % additional_get_params)
+ additional_get_params = urllib.urlencode(dict([k, v.encode('utf-8')] for k, v in request.GET.items()))
+
+ parsed_forward = urlparse(forward)
+
+ # If there is already some parsed query in the URL then change the forward URL
+ if parsed_forward.query:
+ forward_url = forward + "&%s" % additional_get_params
+ else:
+ forward_url = forward + "?%s" % additional_get_params
+
+ return HttpResponseRedirect(forward_url)