From f67b461c434d0a858be3c2597c4c4d288e5b4686 Mon Sep 17 00:00:00 2001 From: Alireza Adli Date: Wed, 7 Aug 2024 15:44:38 -0400 Subject: [PATCH] Add commit changes --- scrub_layer_class.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scrub_layer_class.py b/scrub_layer_class.py index 69bbbb3..d5d386f 100644 --- a/scrub_layer_class.py +++ b/scrub_layer_class.py @@ -161,6 +161,7 @@ class ScrubLayer: with edit(self.layer): for feature in self.layer.getFeatures(request): self.layer.deleteFeature(feature.id()) + self.layer.commitChanges() def add_field(self, new_field_name): functionalities = self.layer.dataProvider().capabilities() @@ -175,7 +176,8 @@ class ScrubLayer: idx = self.layer.fields().indexFromName(field_name) context = QgsExpressionContext() - context.appendScopes(QgsExpressionContextUtils.globalProjectLayerScopes(self.layer)) + context.appendScopes( + QgsExpressionContextUtils.globalProjectLayerScopes(self.layer)) for feature in self.layer.getFeatures(): area = feature.geometry().area()