From 8999182e6933a9684128dcd5d68d5283fd8d189c Mon Sep 17 00:00:00 2001 From: LePetitTim Date: Thu, 19 Jan 2023 18:21:57 +0100 Subject: [PATCH] fix: remove delete mutate, not useful --- geotrek/core/models.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/geotrek/core/models.py b/geotrek/core/models.py index 1e92f958a0..0108874d7e 100644 --- a/geotrek/core/models.py +++ b/geotrek/core/models.py @@ -486,17 +486,16 @@ def overlapping(cls, queryset, all_objects=None): select={'ordering': ordering}, order_by=('ordering',)) return queryset - def mutate(self, other, delete=True): + def mutate(self, other): """ Take alls attributes of the other topology specified and save them into this one. Optionnally deletes the other. """ self.offset = other.offset self.save(update_fields=['offset']) - if delete: - PathAggregation.objects.filter(topo_object=self).delete() - # The previous operation has put deleted = True (in triggers) - # and NULL in geom (see update_geometry_of_topology:: IF t_count = 0) + PathAggregation.objects.filter(topo_object=self).delete() + # The previous operation has put deleted = True (in triggers) + # and NULL in geom (see update_geometry_of_topology:: IF t_count = 0) self.deleted = False self.geom = other.geom self.save(update_fields=['deleted', 'geom'])