From cb69ece6ca5ba04e94dcc2758f53869c70224592 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Thu, 7 Nov 2024 19:33:52 +0100 Subject: [PATCH] =?UTF-8?q?Les=20=C3=A9v=C3=A9nements=20sans=20localisatio?= =?UTF-8?q?n=20sont=20ceux=20qui=20en=20ont=20vraiment=20besoin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/agenda_culturel/models.py | 3 +++ src/agenda_culturel/templatetags/event_extra.py | 2 +- src/agenda_culturel/views.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py index a722dac..0612e7f 100644 --- a/src/agenda_culturel/models.py +++ b/src/agenda_culturel/models.py @@ -649,6 +649,9 @@ class Event(models.Model): def nb_draft_events(): return Event.objects.filter(status=Event.STATUS.DRAFT).count() + def get_qs_events_with_unkwnon_place(): + return Event.objects.filter(exact_location__isnull=True).filter(~Q(status=Event.STATUS.TRASH)).filter(Q(possibly_duplicated=None)|Q(masked=False)) + def download_image(self): # first download file diff --git a/src/agenda_culturel/templatetags/event_extra.py b/src/agenda_culturel/templatetags/event_extra.py index b039f49..1cc1221 100644 --- a/src/agenda_culturel/templatetags/event_extra.py +++ b/src/agenda_culturel/templatetags/event_extra.py @@ -78,7 +78,7 @@ def show_badges_events(placement="top"): @register.simple_tag def show_badge_unknown_places(placement="top"): - nb_unknown = Event.objects.filter(exact_location__isnull=True).count() + nb_unknown = Event.get_qs_events_with_unkwnon_place().count() if nb_unknown != 0: return mark_safe( '