From 273287a250a7bdeb2c0b1d59e6e6dec9ef77abb8 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sat, 28 Dec 2024 17:13:06 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20bug=20quand=20un=20=C3=A9v=C3=A9nement=20?= =?UTF-8?q?n'a=20pas=20tous=20les=20champs=20d=C3=A9finis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/agenda_culturel/models.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py index c6071c5..2405841 100644 --- a/src/agenda_culturel/models.py +++ b/src/agenda_culturel/models.py @@ -1511,9 +1511,12 @@ class Event(models.Model): self.uuids.append(uuid) # add possible missing sources - for source in other.import_sources: - if source not in self.import_sources: - self.import_sources.append(source) + if other.import_sources: + if not self.import_sources: + self.import_sources = [] + for source in other.import_sources: + if source not in self.import_sources: + self.import_sources.append(source) # Limitation: the given events should not be considered similar one to another... def import_events(events, remove_missing_from_source=None, user_id=None):