﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30038	New shortcut: redirect_with_params()	agustin bacigalup	nobody	"I'd like to contribute to Django by adding a shorcut, similar to `django.shortcuts.redirect` but also appends request's GET parameters. I found myself using it a lot, and I wonder if it's useful for the community. If so, should I fork Django on Github and submit a pull request?

{{{
def redirect_with_params(request, to, *args, **kwargs):
    """"""
    Same as `django.shortcuts.redirect` but recieves a `request` as first parameter.
    It preserves the GET parameters from the `request` in the URL redirected.
    """"""
    response = redirect(to, *args, **kwargs)
    url = response.url
    params = request.GET.urlencode()
    if params:
        url = ""%s?%s"" % (response.url, params)
    return response.__class__(url)
}}}
"	New feature	closed	Uncategorized	2.1	Normal	wontfix			Unreviewed	0	0	0	0	0	0
