mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-19 05:21:55 -06:00
Fixes #5109: Fix representation of custom choice field values for webhook data
This commit is contained in:
parent
c891f43b14
commit
47a6fc19ca
@ -5,6 +5,7 @@
|
|||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* [#5050](https://github.com/netbox-community/netbox/issues/5050) - Fix potential failure on `0016_replicate_interfaces` schema migration from old release
|
* [#5050](https://github.com/netbox-community/netbox/issues/5050) - Fix potential failure on `0016_replicate_interfaces` schema migration from old release
|
||||||
|
* [#5109](https://github.com/netbox-community/netbox/issues/5109) - Fix representation of custom choice field values for webhook data
|
||||||
* [#5111](https://github.com/netbox-community/netbox/issues/5111) - Allow use of tuples when specifying ObjectVar `query_params`
|
* [#5111](https://github.com/netbox-community/netbox/issues/5111) - Allow use of tuples when specifying ObjectVar `query_params`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -158,7 +158,7 @@ class CustomFieldModelSerializer(ValidatedModelSerializer):
|
|||||||
instance.custom_fields = {}
|
instance.custom_fields = {}
|
||||||
for field in custom_fields:
|
for field in custom_fields:
|
||||||
value = instance.cf.get(field.name)
|
value = instance.cf.get(field.name)
|
||||||
if field.type == CustomFieldTypeChoices.TYPE_SELECT and value:
|
if field.type == CustomFieldTypeChoices.TYPE_SELECT and type(value) is CustomFieldChoice:
|
||||||
instance.custom_fields[field.name] = CustomFieldChoiceSerializer(value).data
|
instance.custom_fields[field.name] = CustomFieldChoiceSerializer(value).data
|
||||||
else:
|
else:
|
||||||
instance.custom_fields[field.name] = value
|
instance.custom_fields[field.name] = value
|
||||||
|
Loading…
Reference in New Issue
Block a user