1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

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 7acbeb55bc
commit 853b1fad15
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