diff --git a/app/entreprises/forms.py b/app/entreprises/forms.py index c564b24d4..61d517b7c 100644 --- a/app/entreprises/forms.py +++ b/app/entreprises/forms.py @@ -471,6 +471,7 @@ class CorrespondantModificationForm(FlaskForm): if not self.telephone.data and not self.mail.data: msg = "Saisir un moyen de contact (mail ou téléphone)" self.telephone.errors.append(msg) + self.mail.errors.append(msg) validate = False return validate @@ -690,7 +691,7 @@ class TaxeApprentissageModificationForm(FlaskForm): class EnvoiOffreForm(FlaskForm): responsables = FieldList( - _build_string_field( + StringField( "Responsable (*)", render_kw={ "placeholder": "Tapez le nom du responsable de formation", @@ -703,6 +704,8 @@ class EnvoiOffreForm(FlaskForm): def validate(self): validate = True + list_select = True + if not FlaskForm.validate(self): validate = False @@ -718,8 +721,12 @@ class EnvoiOffreForm(FlaskForm): .first() ) if responsable is None: - entry.errors.append("Champ incorrect (selectionnez dans la liste)") - validate = False + validate, list_select = False, False + + if list_select is False: + self.responsables.errors.append( + "Champ incorrect (selectionnez dans la liste)" + ) return validate diff --git a/app/static/css/entreprises.css b/app/static/css/entreprises.css index 14c8f2103..45d3f7629 100644 --- a/app/static/css/entreprises.css +++ b/app/static/css/entreprises.css @@ -131,7 +131,7 @@ margin-right: 20px; } -.title-form { +.title-form-error { font-weight: bold; color: #a94442 } \ No newline at end of file diff --git a/app/templates/entreprises/ajout_correspondants.html b/app/templates/entreprises/ajout_correspondants.html index 487916038..fd0fe64b0 100644 --- a/app/templates/entreprises/ajout_correspondants.html +++ b/app/templates/entreprises/ajout_correspondants.html @@ -16,9 +16,10 @@