From 98092de1f0add3e356e651b8f27aa717e828102f Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sun, 24 Nov 2024 10:56:05 +0100 Subject: [PATCH] =?UTF-8?q?On=20ne=20met=20pas=20=C3=A0=20jour=20les=20inf?= =?UTF-8?q?ormations=20mod=C3=A9r=C3=A9es=20quand=20on=20met=20=C3=A0=20jo?= =?UTF-8?q?ur=20un=20import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #214 --- src/agenda_culturel/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py index 117fd91..e816b4e 100644 --- a/src/agenda_culturel/models.py +++ b/src/agenda_culturel/models.py @@ -1380,7 +1380,8 @@ class Event(models.Model): def update(self, other, all): - if other.has_pending_organisers(): + # do not update if all is false + if other.has_pending_organisers() and not all: self.organisers.set(other.pending_organisers) # set attributes @@ -1456,7 +1457,8 @@ class Event(models.Model): if same_imported.other_versions.representative != same_imported: same_imported.other_versions.representative = None same_imported.other_versions.save() - same_imported.update(event, pure) # we only update all tags if it"s a pure import + # we only update local information if it's a pure import and has no moderated_date + same_imported.update(event, pure and same_imported.moderated_date is None) same_imported.set_in_importation_process() same_imported.prepare_save() to_update.append(same_imported)