diff --git a/lemarche/templates/tenders/_detail_contact.html b/lemarche/templates/tenders/_detail_contact.html index 504f41f94..11de4b7fa 100644 --- a/lemarche/templates/tenders/_detail_contact.html +++ b/lemarche/templates/tenders/_detail_contact.html @@ -14,10 +14,10 @@

{{ tender.contact_full_name|safe }} {% endif %} - {% if tender.author.company_name %} + {% if tender.contact_company_name_display %}
- {{ tender.author.company_name }} + {{ tender.contact_company_name_display }}
{% endif %} {% if tender.can_display_contact_email or source == "alert" and not tender.response_kind_is_only_external %} diff --git a/lemarche/tenders/models.py b/lemarche/tenders/models.py index 1b325c4dd..51a6b10a3 100644 --- a/lemarche/tenders/models.py +++ b/lemarche/tenders/models.py @@ -440,6 +440,13 @@ def save(self, *args, **kwargs): def contact_full_name(self) -> str: return f"{self.contact_first_name} {self.contact_last_name}" + def contact_company_name_display(self) -> str: + if self.contact_company_name: + return self.contact_company_name + elif self.author.company_name: + return self.author.company_name + return "" + def sectors_list(self): return self.sectors.form_filter_queryset().values_list("name", flat=True)