From f609537347626d1c26acc2156e2367109afda080 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Fri, 12 Jan 2024 16:14:53 +0200 Subject: [PATCH] Update comment in `update_data_provider` Co-authored-by: Matthias Kuhn --- libqfieldsync/offliners.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libqfieldsync/offliners.py b/libqfieldsync/offliners.py index 1e31878..1c9ccc0 100644 --- a/libqfieldsync/offliners.py +++ b/libqfieldsync/offliners.py @@ -296,9 +296,8 @@ def update_data_provider(layer: QgsVectorLayer, source: str) -> None: layer.setCustomProperty(CUSTOM_PROPERTY_ORIGINAL_LAYERID, layer.id()) layer.setCustomProperty(CUSTOM_PROPERTY_LAYERNAME_SUFFIX, "") - # TODO: review this code, why do we connect defaultvalueclause to not null constraints? - # - # remove constrainst of fields that use defaultValueClauses from provider on original + # Remove constraints from fields that have a default value provided by the "online" provider. + # Example: a user should not be forced to enter an autogenerated primary key in offline mode, compare https://github.com/qgis/QGIS/issues/28122 not_null_field_names = [] source_fields = layer.fields() for field in source_fields: