Просмотр исходного кода

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

Jeremy Stretch 7 лет назад
Родитель
Сommit
853b1fad15
2 измененных файлов с 4 добавлено и 2 удалено
  1. 1 0
      CHANGELOG.md
  2. 3 2
      netbox/utilities/views.py

+ 1 - 0
CHANGELOG.md

@@ -11,6 +11,7 @@ v2.5.2 (FUTURE)
 * [#2691](https://github.com/digitalocean/netbox/issues/2691) - Cable trace should follow circuits
 * [#2698](https://github.com/digitalocean/netbox/issues/2698) - Remove pagination restriction on bulk component creation for devices/VMs
 * [#2707](https://github.com/digitalocean/netbox/issues/2707) - Correct permission evaluation for circuit termination cabling
+* [#2712](https://github.com/digitalocean/netbox/issues/2712) - Preserve list filtering after editing objects in bulk
 
 ---
 

+ 3 - 2
netbox/utilities/views.py

@@ -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