Fixes #2712: Preserve list filtering after editing objects in bulk

This commit is contained in:
Jeremy Stretch
2018-12-20 15:33:53 -05:00
parent 9408e50eb4
commit 68446533b3
2 changed files with 4 additions and 2 deletions

View File

@@ -55,8 +55,9 @@ class GetReturnURLMixin(object):
def get_return_url(self, request, obj=None):
# First, see if `return_url` was specified as a query parameter. Use it only if it's considered safe.
query_param = request.GET.get('return_url')
# First, see if `return_url` was specified as a query parameter or form data. Use this URL only if it's
# considered safe.
query_param = request.GET.get('return_url') or request.POST.get('return_url')
if query_param and is_safe_url(url=query_param, allowed_hosts=request.get_host()):
return query_param