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

Fixes #7324: Fix TypeError exception in web UI when filtering objects using single-choice filters

This commit is contained in:
jeremystretch
2021-09-21 09:13:26 -04:00
parent 6bc72109c1
commit 41dfdc0aaa
2 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,11 @@
# NetBox v3.0
## v3.0.4 (FUTURE)
### Bug Fixes
* [#7324](https://github.com/netbox-community/netbox/issues/7324) - Fix TypeError exception in web UI when filtering objects using single-choice filters
## v3.0.3 (2021-09-20)
### Enhancements

View File

@ -137,6 +137,8 @@ def get_selected_values(form, field_name):
else:
# Static selection field
choices = unpack_grouped_choices(field.choices)
if type(filter_data) not in (list, tuple):
filter_data = [filter_data] # Ensure filter data is iterable
values = [
label for value, label in choices if str(value) in filter_data or None in filter_data
]