Skip to content

Commit

Permalink
Merge pull request #237 from digital-land/fix/get_entity_geometry
Browse files Browse the repository at this point in the history
updated filter to stop error if geojson is undefined
  • Loading branch information
GeorgeGoodall authored Jan 24, 2024
2 parents 0f06598 + c712d5b commit 1aeeea7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion application/core/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,15 @@ def make_link_filter(eval_ctx, url, **kwargs):


def get_entity_geometry(entity):
data = entity.geojson.geometry if entity.geojson else None
if data is None:
logger.warning(
f"No geojson for entity that has a typology of geography: {entity.entity}",
entity,
)
return {
"name": get_entity_name(entity),
"data": entity.geojson.geometry,
"data": data,
"entity": entity.entity,
}

Expand Down

0 comments on commit 1aeeea7

Please sign in to comment.