From 8c86f3460fa4bad5d01c8a80419cdc01d1e45c48 Mon Sep 17 00:00:00 2001 From: wlorenzetti Date: Tue, 10 Oct 2023 16:09:03 +0200 Subject: [PATCH] Case layer with more than one geometry field. --- 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 ee6397953..d5eff819b 100644 --- a/g3w-admin/editing/api/base/views.py +++ b/g3w-admin/editing/api/base/views.py @@ -274,6 +274,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'):