Skip to content

Commit 6ad73eb

Browse files
committed
Handle feature with crs=null
1 parent 88f0fbc commit 6ad73eb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/server.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,8 @@ def post(self, dataset):
492492
if 'error' not in result:
493493
relationValues = data_service.write_relation_values(get_identity(), result['feature']['id'], feature.get('relationValues', '{}'), request.files, translator, True)
494494
# Requery feature because the write_relation_values may change the feature through DB triggers
495-
result = data_service.show(get_identity(), translator, dataset, result['feature']['id'], feature.get('crs', {}).get('properties', {}).get('name'))
495+
crs = feature['crs']['properties']['name'] if feature['crs'] else None
496+
result = data_service.show(get_identity(), translator, dataset, result['feature']['id'], crs)
496497
if 'error' not in result:
497498
feature = result['feature']
498499
feature['relationValues'] = relationValues
@@ -543,7 +544,8 @@ def put(self, dataset, id):
543544
if 'error' not in result:
544545
relationValues = data_service.write_relation_values(get_identity(), result['feature']['id'], feature.get('relationValues', {}), request.files, translator)
545546
# Requery feature because the write_relation_values may change the feature through DB triggers
546-
result = data_service.show(get_identity(), translator, dataset, id, feature.get('crs', {}).get('properties', {}).get('name'))
547+
crs = feature['crs']['properties']['name'] if feature['crs'] else None
548+
result = data_service.show(get_identity(), translator, dataset, id, crs)
547549
if 'error' not in result:
548550
feature = result['feature']
549551
feature['relationValues'] = relationValues

0 commit comments

Comments
 (0)