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

Explicitly use the value of the choice, instead of relying on __str__

This commit is contained in:
Saria Hajjar
2020-01-23 17:37:51 +00:00
parent 0ab19d723d
commit 0a5eecd0e3
2 changed files with 1 additions and 4 deletions

View File

@ -61,7 +61,7 @@ def get_custom_fields_for_model(content_type, filterable_only=False, bulk_edit=F
# Select
elif cf.type == CustomFieldTypeChoices.TYPE_SELECT:
choices = [(cfc.pk, cfc) for cfc in cf.choices.all()]
choices = [(cfc.pk, cfc.value) for cfc in cf.choices.all()]
if not cf.required or bulk_edit or filterable_only:
choices = [(None, '---------')] + choices
# Check for a default choice