From a1f271d7d9cb1728a5f97379c3af10cae6f3b633 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Fri, 1 Oct 2021 14:07:26 -0400 Subject: [PATCH] Fixes #7417: Prevent exception when filtering objects list by invalid tag --- docs/release-notes/version-3.0.md | 1 + netbox/utilities/templatetags/helpers.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index 16b3c6482..b4d6bb4ac 100644 --- a/docs/release-notes/version-3.0.md +++ b/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 --- diff --git a/netbox/utilities/templatetags/helpers.py b/netbox/utilities/templatetags/helpers.py index 532eea19b..a900d59e2 100644 --- a/netbox/utilities/templatetags/helpers.py +++ b/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