From 2b56986712be99b24db147c6b4713415754238d6 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Tue, 23 Apr 2024 22:58:30 +0200 Subject: [PATCH] fix comparaison objets nuls --- src/agenda_culturel/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py index 47b4d60..59061ea 100644 --- a/src/agenda_culturel/models.py +++ b/src/agenda_culturel/models.py @@ -146,6 +146,7 @@ class DuplicatedEvents(models.Model): def get_item_comparison(self, attr): values = [getattr(e, attr) for e in self.get_duplicated()] + values = ["" if v is None else v for v in values] if len(set([str(v) for v in values])) == 1: return { "similar": True, "key": attr, "values": values[0] }