From e6a2c0fc540b25b7e353d453d5d3287e21b9800c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Cant=C3=B9?= Date: Thu, 16 May 2024 14:10:15 +0200 Subject: [PATCH] map is not required for layer groups --- metadata_catalogue/maps/api/serializers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/metadata_catalogue/maps/api/serializers.py b/metadata_catalogue/maps/api/serializers.py index a2c8da7..f35b6fb 100644 --- a/metadata_catalogue/maps/api/serializers.py +++ b/metadata_catalogue/maps/api/serializers.py @@ -106,8 +106,10 @@ class Meta: class LayerGroupSerializer(serializers.ModelSerializer): - map = serializers.SlugRelatedField(slug_field="slug", queryset=Map.objects.all(), allow_null=True) - parent = serializers.SlugRelatedField(slug_field="slug", queryset=LayerGroup.objects.all(), allow_null=True) + map = serializers.SlugRelatedField(slug_field="slug", queryset=Map.objects.all(), allow_null=True, required=False) + parent = serializers.SlugRelatedField( + slug_field="slug", queryset=LayerGroup.objects.all(), allow_null=True, required=False + ) class Meta: model = LayerGroup