Thanks for the replies Rajesh and Bruno, they were very helpful!
On Jan 2, 3:18 pm, bruno desthuilliers <
bruno.desthuilli...@gmail.com>
wrote:
> # NB : Q&D, not tested
> def my_redirect_to(request, url):
> qs = request.META.QUERY_STRING
> if qs:
> url = "%s?%s" % (url, qs)
> return redirect_to(url)
Here's the solution I ended up with (it also forwards keyword args):
def redirect_to_with_query(request, url, **kwargs):
query_string = request.META["QUERY_STRING"]
if query_string:
url = "%s?%s" % (url, query_string)
return redirect_to(request, url, **kwargs)
Cheers,
Filipe