From d430836ae2fa6ec68ff11d16387f078bf980973c Mon Sep 17 00:00:00 2001 From: Walter Lorenzetti Date: Tue, 10 Oct 2023 16:06:35 +0200 Subject: [PATCH] :bug: Fix more than one geometry field on editing update. (#614) Co-authored-by: wlorenzetti --- g3w-admin/editing/api/base/views.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/g3w-admin/editing/api/base/views.py b/g3w-admin/editing/api/base/views.py index 2fb47a45b..8513fd607 100644 --- a/g3w-admin/editing/api/base/views.py +++ b/g3w-admin/editing/api/base/views.py @@ -275,6 +275,11 @@ def save_vector_data(self, metadata_layer, post_layer_data, has_transactions, po feature.setAttribute(qgis_field.name(), qgis_layer.dataProvider().defaultValueClause(field_idx)) + # + elif qgis_field.typeName().lower() in ('geometry', ): + if geojson_feature['properties'][qgis_field.name()] == '': + geojson_feature['properties'][qgis_field.name()] = None + # Formatting data if field's type is date, datetime or time # ---------------------------------------------------------- elif qgis_field.typeName().lower() in ('date', 'datetime', 'time', 'timestamp'):