From 679447696428af405552d534e7bae34764948c0c Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Thu, 28 Sep 2023 12:06:45 +0200 Subject: [PATCH] Fix re-add property --- lemarche/templates/tenders/detail.html | 6 +++--- lemarche/tenders/models.py | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lemarche/templates/tenders/detail.html b/lemarche/templates/tenders/detail.html index 4f78ca0c8..3556d032c 100644 --- a/lemarche/templates/tenders/detail.html +++ b/lemarche/templates/tenders/detail.html @@ -104,7 +104,7 @@ - {{ tender.siae_email_link_click_or_detail_display_count }} prestataire{{ tender.siae_email_link_click_or_detail_display_count|pluralize }} qui {{ tender.siae_email_link_click_or_detail_display_count|pluralize:'a,ont' }} vu + {{ tender.siae_email_link_click_date_or_detail_display_date_count }} prestataire{{ tender.siae_email_link_click_date_or_detail_display_date_count|pluralize }} qui {{ tender.siae_email_link_click_date_or_detail_display_date_count|pluralize:'a,ont' }} vu @@ -116,8 +116,8 @@ {% if tender.siae_email_link_click_or_detail_display_count > 0 %} {% endif %} diff --git a/lemarche/tenders/models.py b/lemarche/tenders/models.py index c55587476..ca82050d7 100644 --- a/lemarche/tenders/models.py +++ b/lemarche/tenders/models.py @@ -570,6 +570,12 @@ def siae_detail_display_date_count(self): def siae_email_send_date_count(self): return self.tendersiae_set.filter(email_send_date__isnull=False).count() + @property + def siae_email_link_click_date_or_detail_display_date_count(self): + return self.tendersiae_set.filter( + Q(email_link_click_date__isnull=False) | Q(detail_display_date__isnull=False) + ).count() + @property def siae_detail_contact_click_date_count(self): return self.tendersiae_set.filter(detail_contact_click_date__isnull=False).count()