Skip to content

Commit

Permalink
Do not change subtype of empty maps
Browse files Browse the repository at this point in the history
  • Loading branch information
ridoo committed Aug 26, 2024
1 parent 4c9c333 commit 0398af7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion geonode/maps/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@ def perform_create(self, serializer):
post_creation_data = {"thumbnail": serializer.validated_data.pop("thumbnail_url", "")}
map_layers = serializer.validated_data.get("maplayers", [])
tabular_collection = all(layer.dataset and ("tabular" in layer.dataset.subtype) for layer in map_layers)
subtype = "tabular-collection" if len(map_layers) > 0 and tabular_collection else None

instance = serializer.save(
owner=self.request.user,
resource_type="map",
subtype="tabular-collection" if tabular_collection else None,
subtype=subtype,
uuid=str(uuid4()),
)

Expand Down

0 comments on commit 0398af7

Please sign in to comment.