mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 09:16:10 -06:00
9608 fix choices default
This commit is contained in:
parent
7369c772c4
commit
7120a0384c
@ -644,7 +644,7 @@ class DeviceSerializer(NetBoxModelSerializer):
|
||||
site = NestedSiteSerializer()
|
||||
location = NestedLocationSerializer(required=False, allow_null=True, default=None)
|
||||
rack = NestedRackSerializer(required=False, allow_null=True, default=None)
|
||||
face = ChoiceField(choices=DeviceFaceChoices, allow_blank=True, default='')
|
||||
face = ChoiceField(choices=DeviceFaceChoices, allow_blank=True, default=lambda: '')
|
||||
position = serializers.DecimalField(
|
||||
max_digits=4,
|
||||
decimal_places=1,
|
||||
@ -1168,15 +1168,19 @@ class PowerFeedSerializer(NetBoxModelSerializer, CabledObjectSerializer, Connect
|
||||
)
|
||||
type = ChoiceField(
|
||||
choices=PowerFeedTypeChoices,
|
||||
default=lambda: PowerFeedTypeChoices.TYPE_PRIMARY,
|
||||
)
|
||||
status = ChoiceField(
|
||||
choices=PowerFeedStatusChoices,
|
||||
default=lambda: PowerFeedStatusChoices.STATUS_ACTIVE,
|
||||
)
|
||||
supply = ChoiceField(
|
||||
choices=PowerFeedSupplyChoices,
|
||||
default=lambda: PowerFeedSupplyChoices.SUPPLY_AC,
|
||||
)
|
||||
phase = ChoiceField(
|
||||
choices=PowerFeedPhaseChoices,
|
||||
default=lambda: PowerFeedPhaseChoices.PHASE_SINGLE,
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
@ -99,7 +99,7 @@ class ContactAssignmentSerializer(NetBoxModelSerializer):
|
||||
object = serializers.SerializerMethodField(read_only=True)
|
||||
contact = NestedContactSerializer()
|
||||
role = NestedContactRoleSerializer(required=False, allow_null=True)
|
||||
priority = extend_schema_field(OpenApiTypes.STR)(ChoiceField(choices=ContactPriorityChoices, allow_blank=True, required=False, default=''))
|
||||
priority = ChoiceField(choices=ContactPriorityChoices, allow_blank=True, required=False, default=lambda: '')
|
||||
|
||||
class Meta:
|
||||
model = ContactAssignment
|
||||
|
Loading…
Reference in New Issue
Block a user