call register_changed_geometries only if locationgroup was not changed
This commit is contained in:
parent
9564d92ec3
commit
b20c94b6c6
1 changed files with 3 additions and 2 deletions
|
@ -222,7 +222,7 @@ class LocationGroupCategory(SerializableMixin, models.Model):
|
|||
group.register_changed_geometries(do_query=False)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if self.priority != self.orig_priority:
|
||||
if self.pk and self.priority != self.orig_priority:
|
||||
self.register_changed_geometries()
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
|
@ -308,7 +308,8 @@ class LocationGroup(Location, models.Model):
|
|||
return (1, self.category.priority, self.priority)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if (self.orig_color != self.color or
|
||||
if (self.pk and
|
||||
self.orig_color != self.color or
|
||||
self.priority != self.orig_priority or
|
||||
self.category_id != self.orig_category_id):
|
||||
self.register_changed_geometries()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue