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:
@ -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
|
||||
|
@ -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
|
||||
]
|
||||
|
Reference in New Issue
Block a user