def redirect_with_get(view_name, get_querydict, do_reverse=True):
 if do_reverse:
  url = reverse(view_name)
 else:
  url = view_name
 if get_querydict:
  return redirect(('%s?%s' % (url, get_querydict.urlencode(safe='/'))))
 return redirect(view_name)

def redirect_with_get ( view_name , get_querydict , do_reverse = True ) : if do_reverse : url = reverse ( view_name ) else : url = view_name if get_querydict : return redirect ( ( '%s?%s' % ( url , get_querydict . urlencode ( safe = '/' ) ) ) ) return redirect ( view_name )
helper function to carry over get parameters across redirects using urlencode because the @login_required decorator generates next queryparams with / unencoded .