From 343038cc9840cd21b385c0aafdf1c98dd6145b06 Mon Sep 17 00:00:00 2001 From: davy39 Date: Sun, 23 Jan 2022 23:31:20 +0100 Subject: [PATCH] Correction validation Resp 2 --- inscription/forms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inscription/forms.py b/inscription/forms.py index 498155f..29bb25d 100644 --- a/inscription/forms.py +++ b/inscription/forms.py @@ -201,7 +201,8 @@ def clean(self): else: msg = forms.ValidationError("Veuillez renseigner ce champs SVP.") for field in required: - self.add_error(field, msg) + if self.cleaned_data.get(field) is None: + self.add_error(field, msg) return self.cleaned_data class Meta: