From da1beecdc52d2e6baa9e718dabf93bc6f0778181 Mon Sep 17 00:00:00 2001 From: wlorenzetti Date: Tue, 10 Oct 2023 12:04:49 +0200 Subject: [PATCH] :bug: Fix more than one geometry field on editing update. --- 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'):