Explorar o código

Fixes #3072: Preserve multiselect filter values when updating per-page count for list views

Jeremy Stretch %!s(int64=6) %!d(string=hai) anos
pai
achega
1491222642
Modificáronse 2 ficheiros con 5 adicións e 2 borrados
  1. 1 0
      CHANGELOG.md
  2. 4 2
      netbox/templates/inc/paginator.html

+ 1 - 0
CHANGELOG.md

@@ -9,6 +9,7 @@
 ## Bug Fixes
 ## Bug Fixes
 
 
 * [#2621](https://github.com/digitalocean/netbox/issues/2621) - Upgrade Django requirement to 2.2 to fix object deletion issue in the changelog middleware
 * [#2621](https://github.com/digitalocean/netbox/issues/2621) - Upgrade Django requirement to 2.2 to fix object deletion issue in the changelog middleware
+* [#3072](https://github.com/digitalocean/netbox/issues/3072) - Preserve multiselect filter values when updating per-page count for list views
 * [#3112](https://github.com/digitalocean/netbox/issues/3112) - Fix ordering of interface connections list by termination B name/device
 * [#3112](https://github.com/digitalocean/netbox/issues/3112) - Fix ordering of interface connections list by termination B name/device
 * [#3116](https://github.com/digitalocean/netbox/issues/3116) - Fix `tagged_items` count in tags API endpoint
 * [#3116](https://github.com/digitalocean/netbox/issues/3116) - Fix `tagged_items` count in tags API endpoint
 * [#3118](https://github.com/digitalocean/netbox/issues/3118) - Disable `last_login` update on login when maintenance mode is enabled
 * [#3118](https://github.com/digitalocean/netbox/issues/3118) - Disable `last_login` update on login when maintenance mode is enabled

+ 4 - 2
netbox/templates/inc/paginator.html

@@ -20,9 +20,11 @@
             </ul>
             </ul>
         </nav>
         </nav>
         <form method="get">
         <form method="get">
-            {% for k, v in request.GET.items %}
+            {% for k, v_list in request.GET.lists %}
                 {% if k != 'per_page' %}
                 {% if k != 'per_page' %}
-                    <input type="hidden" name="{{ k }}" value="{{ v }}" />
+                    {% for v in v_list %}
+                        <input type="hidden" name="{{ k }}" value="{{ v }}" />
+                    {% endfor %}
                 {% endif %}
                 {% endif %}
             {% endfor %}
             {% endfor %}
             <select name="per_page" id="per_page">
             <select name="per_page" id="per_page">