From 96143c03a451acad5481532d0b1dd306751c5982 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Tue, 16 Apr 2024 11:32:36 +0200 Subject: [PATCH] Coorection d'un bug dans l'application des questions --- src/agenda_culturel/models.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py index 02cbb1d..9c4d76d 100644 --- a/src/agenda_culturel/models.py +++ b/src/agenda_culturel/models.py @@ -910,13 +910,15 @@ class ModerationAnswer(models.Model): def valid_event(self, event): if event.tags: - for t in self.adds_tags: - if t not in event.tags: - return False + if self.adds_tags: + for t in self.adds_tags: + if t not in event.tags: + return False - for t in self.removes_tags: - if t in event.tags: - return False + if self.removes_tags: + for t in self.removes_tags: + if t in event.tags: + return False return True else: