From c122b3a8f61922a53bb87c6e84c0d84566e6fe45 Mon Sep 17 00:00:00 2001 From: "madjid.asa" Date: Thu, 19 Oct 2023 11:30:05 +0200 Subject: [PATCH] external link is required if tender is tender kind --- lemarche/www/tenders/forms.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lemarche/www/tenders/forms.py b/lemarche/www/tenders/forms.py index 79d8017d8..b9edfc783 100644 --- a/lemarche/www/tenders/forms.py +++ b/lemarche/www/tenders/forms.py @@ -107,6 +107,10 @@ def __init__(self, kind, questions_list=None, *args, **kwargs): if self.kind != tender_constants.KIND_TENDER: self.fields["external_link"].label = "Lien à partager" self.fields["external_link"].help_text = None + + if self.kind == tender_constants.KIND_TENDER: + self.fields["external_link"].required = True + self.fields["amount"].label = "Montant € estimé de votre besoin" self.fields["accept_share_amount"].label = self.fields["accept_share_amount"].help_text self.fields["external_link"].widget.attrs["placeholder"] = "https://www.example.fr"