Skip to content

Commit

Permalink
prevent fetching datasets without metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokant committed Nov 21, 2023
1 parent f9c2aeb commit 8cb2428
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion metadata_catalogue/datasets/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ def as_geoapi_resource(self, base_url, *args, warn=True, **kwargs):
logger.warn("DANGER: This method consumes the queryset and returns and array of items")
return [
ResourceMapping(instance, base_url).as_resource()
for instance in self.exclude(metadata=None, metadata__bounding_box=None)
for instance in self.select_related("metadata", "content").exclude(
metadata=None, metadata__bounding_box=None, content=None
)
]


Expand Down

0 comments on commit 8cb2428

Please sign in to comment.