Преглед изворни кода

Merge pull request #2967 from Anthony25/fix_cable_length_unit_api

Allow nullable length unit in cable API
Jeremy Stretch пре 7 година
родитељ
комит
0572c66c17
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      netbox/dcim/api/serializers.py

+ 1 - 1
netbox/dcim/api/serializers.py

@@ -507,7 +507,7 @@ class CableSerializer(ValidatedModelSerializer):
     termination_a = serializers.SerializerMethodField(read_only=True)
     termination_b = serializers.SerializerMethodField(read_only=True)
     status = ChoiceField(choices=CONNECTION_STATUS_CHOICES, required=False)
-    length_unit = ChoiceField(choices=CABLE_LENGTH_UNIT_CHOICES, required=False)
+    length_unit = ChoiceField(choices=CABLE_LENGTH_UNIT_CHOICES, required=False, allow_null=True)
 
     class Meta:
         model = Cable