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