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( '