diff --git a/src/agenda_culturel/models/event.py b/src/agenda_culturel/models/event.py index dad073e..e127e62 100644 --- a/src/agenda_culturel/models/event.py +++ b/src/agenda_culturel/models/event.py @@ -174,7 +174,6 @@ class DuplicatedEvents(models.Model): super().save(*args, **kwargs) def get_import_messages(self): - from . import Message msgs = [] for e in self.get_duplicated(): @@ -426,7 +425,7 @@ class Event(models.Model): if not self.is_modification_locked(now): self.editing_start = now self.editing_user = user - self.save(update_fields=["editing_start", "editing_user"]) + self.save(update_fields=["editing_start", "editing_user"], no_prepare=True) return True else: return False @@ -438,7 +437,9 @@ class Event(models.Model): self.editing_start = None self.editing_user = None if save: - self.save(update_fields=["editing_start", "editing_user"]) + self.save( + update_fields=["editing_start", "editing_user"], no_prepare=True + ) return True def get_dates(self): @@ -938,7 +939,7 @@ class Event(models.Model): def download_missing_image(self): if self.local_image and not default_storage.exists(self.local_image.name): self.download_image() - self.save(update_fields=["local_image"]) + self.save(update_fields=["local_image"], no_prepare=True) def download_image(self): # first download file @@ -1243,7 +1244,10 @@ class Event(models.Model): return notif def save(self, *args, **kwargs): - self.prepare_save() + if "no_prepare" in kwargs: + del kwargs["no_prepare"] + else: + self.prepare_save() # check for similar events if no duplicated is known and only if the event is created if (