mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Fixes #8498: Fix display of selected content type filters in object list views
This commit is contained in:
parent
ea283365e7
commit
e20ac803f3
@ -19,6 +19,7 @@
|
|||||||
* [#8425](https://github.com/netbox-community/netbox/issues/8425) - Fix exception when viewing change list/records with removed plugins
|
* [#8425](https://github.com/netbox-community/netbox/issues/8425) - Fix exception when viewing change list/records with removed plugins
|
||||||
* [#8456](https://github.com/netbox-community/netbox/issues/8456) - Fix redundant display of VRF RD in prefix view
|
* [#8456](https://github.com/netbox-community/netbox/issues/8456) - Fix redundant display of VRF RD in prefix view
|
||||||
* [#8465](https://github.com/netbox-community/netbox/issues/8465) - Accept empty string values for Interface `rf_channel` in REST API
|
* [#8465](https://github.com/netbox-community/netbox/issues/8465) - Accept empty string values for Interface `rf_channel` in REST API
|
||||||
|
* [#8498](https://github.com/netbox-community/netbox/issues/8498) - Fix display of selected content type filters in object list views
|
||||||
* [#8499](https://github.com/netbox-community/netbox/issues/8499) - Content types REST API endpoint should not require model permission
|
* [#8499](https://github.com/netbox-community/netbox/issues/8499) - Content types REST API endpoint should not require model permission
|
||||||
* [#8512](https://github.com/netbox-community/netbox/issues/8512) - Correct file permissions to allow execution of housekeeping script
|
* [#8512](https://github.com/netbox-community/netbox/issues/8512) - Correct file permissions to allow execution of housekeeping script
|
||||||
|
|
||||||
|
@ -127,12 +127,13 @@ def get_selected_values(form, field_name):
|
|||||||
if not hasattr(field, 'choices'):
|
if not hasattr(field, 'choices'):
|
||||||
return [str(filter_data)]
|
return [str(filter_data)]
|
||||||
|
|
||||||
# Get choice labels
|
# Model choice field
|
||||||
if type(field.choices) is forms.models.ModelChoiceIterator:
|
if type(field.choices) is forms.models.ModelChoiceIterator:
|
||||||
# Field uses dynamic choices: show all that have been populated on the widget
|
# If this is a single-choice field, wrap its value in a list
|
||||||
values = [
|
if not hasattr(filter_data, '__iter__'):
|
||||||
subwidget.choice_label for subwidget in form[field_name].subwidgets
|
values = [filter_data]
|
||||||
]
|
else:
|
||||||
|
values = filter_data
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Static selection field
|
# Static selection field
|
||||||
|
Loading…
Reference in New Issue
Block a user