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()