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

Fixes #7417: Prevent exception when filtering objects list by invalid tag

jeremystretch 4 лет назад
Родитель
Сommit
a1f271d7d9
2 измененных файлов с 4 добавлено и 0 удалено
  1. 1 0
      docs/release-notes/version-3.0.md
  2. 3 0
      netbox/utilities/templatetags/helpers.py

+ 1 - 0
docs/release-notes/version-3.0.md

@@ -17,6 +17,7 @@
 * [#7401](https://github.com/netbox-community/netbox/issues/7401) - Pin `jsonschema` package to v3.2.0 to fix REST API docs rendering
 * [#7411](https://github.com/netbox-community/netbox/issues/7411) - Fix exception in UI when adding member devices to virtual chassis
 * [#7412](https://github.com/netbox-community/netbox/issues/7412) - Fix exception in UI when adding child device to device bay
+* [#7417](https://github.com/netbox-community/netbox/issues/7417) - Prevent exception when filtering objects list by invalid tag
 
 ---
 

+ 3 - 0
netbox/utilities/templatetags/helpers.py

@@ -398,6 +398,9 @@ def applied_filters(form, query_params):
 
     applied_filters = []
     for filter_name in form.changed_data:
+        if filter_name not in form.cleaned_data:
+            continue
+
         querydict = query_params.copy()
         if filter_name not in querydict:
             continue