an attempt to get rid of missing _orig with changesets
This commit is contained in:
parent
ae2303ce22
commit
6390a51fc6
5 changed files with 25 additions and 27 deletions
|
@ -181,10 +181,10 @@ class ObstacleGroup(TitledMixin, models.Model):
|
|||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.orig_color = self.color
|
||||
self._orig = {"color": self.color}
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if self.pk and (self.orig_color != self.color):
|
||||
if self.pk and any(getattr(self, attname) != value for attname, value in self._orig.items()):
|
||||
self.register_changed_geometries()
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue