From 67a2446123ed79264c1af820bc2d1a34b0aa4c24 Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Mon, 2 Oct 2017 21:20:02 +0200 Subject: [PATCH] Make item field non-required on LabelSerializer --- storage/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/serializers.py b/storage/serializers.py index 0fd9699..f7f58a8 100644 --- a/storage/serializers.py +++ b/storage/serializers.py @@ -9,7 +9,7 @@ class ItemSerializer(HStoreSerializer): fields = ('uuid', 'name', 'description', 'props', 'state', 'parent') class LabelSerializer(serializers.ModelSerializer): - item = ItemSerializer() + item = ItemSerializer(required=False) item_id = serializers.PrimaryKeyRelatedField(queryset=Item.objects, source='item') class Meta: model = Label