mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -06:00
Fixes #1818: InventoryItem API serializer no longer requires specifying a null value for items with no parent
This commit is contained in:
parent
7ac27b59c6
commit
5262156e1a
@ -733,6 +733,8 @@ class InventoryItemSerializer(serializers.ModelSerializer):
|
|||||||
|
|
||||||
|
|
||||||
class WritableInventoryItemSerializer(ValidatedModelSerializer):
|
class WritableInventoryItemSerializer(ValidatedModelSerializer):
|
||||||
|
# Provide a default value to satisfy UniqueTogetherValidator
|
||||||
|
parent = serializers.PrimaryKeyRelatedField(queryset=InventoryItem.objects.all(), allow_null=True, default=None)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = InventoryItem
|
model = InventoryItem
|
||||||
|
Loading…
Reference in New Issue
Block a user