an attempt to get rid of missing _orig with changesets

This commit is contained in:
Laura Klünder 2024-12-05 20:42:25 +01:00
parent ae2303ce22
commit 6390a51fc6
5 changed files with 25 additions and 27 deletions

View file

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