Skip to content

Commit

Permalink
fix: remove delete mutate, not useful
Browse files Browse the repository at this point in the history
  • Loading branch information
LePetitTim committed Jan 20, 2023
1 parent b2c45bf commit 8999182
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions geotrek/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down

0 comments on commit 8999182

Please sign in to comment.