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

Fixes #1818: InventoryItem API serializer no longer requires specifying a null value for items with no parent

This commit is contained in:
Jeremy Stretch
2018-01-19 10:30:26 -05:00
parent 7ac27b59c6
commit 5262156e1a

View File

@@ -733,6 +733,8 @@ class InventoryItemSerializer(serializers.ModelSerializer):
class WritableInventoryItemSerializer(ValidatedModelSerializer):
# Provide a default value to satisfy UniqueTogetherValidator
parent = serializers.PrimaryKeyRelatedField(queryset=InventoryItem.objects.all(), allow_null=True, default=None)
class Meta:
model = InventoryItem