Skip to content

Commit

Permalink
Don't assume feature has a crs field
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Nov 27, 2024
1 parent 981b32f commit 95f7ccc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def post(self, dataset):
if 'error' not in result:
relationValues = data_service.write_relation_values(get_identity(), result['feature']['id'], feature.get('relationValues', '{}'), request.files, translator, True)
# Requery feature because the write_relation_values may change the feature through DB triggers
result = data_service.show(get_identity(), translator, dataset, result['feature']['id'], feature['crs']['properties']['name'])
result = data_service.show(get_identity(), translator, dataset, result['feature']['id'], feature.get('crs', {}).get('properties', {}).get('name'))
if 'error' not in result:
feature = result['feature']
feature['relationValues'] = relationValues
Expand Down Expand Up @@ -543,7 +543,7 @@ def put(self, dataset, id):
if 'error' not in result:
relationValues = data_service.write_relation_values(get_identity(), result['feature']['id'], feature.get('relationValues', {}), request.files, translator)
# Requery feature because the write_relation_values may change the feature through DB triggers
result = data_service.show(get_identity(), translator, dataset, id, feature['crs']['properties']['name'])
result = data_service.show(get_identity(), translator, dataset, id, feature.get('crs', {}).get('properties', {}).get('name'))
if 'error' not in result:
feature = result['feature']
feature['relationValues'] = relationValues
Expand Down

0 comments on commit 95f7ccc

Please sign in to comment.