From f42c6e202e67800a20d9a4f86d033abe5c9c511b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Larchev=C3=AAque?= Date: Thu, 12 May 2011 10:42:10 -0400 Subject: [PATCH] fix #1450 --- project/dae/forms.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/project/dae/forms.py b/project/dae/forms.py index e938629..d6eda59 100644 --- a/project/dae/forms.py +++ b/project/dae/forms.py @@ -243,7 +243,15 @@ class PosteForm(forms.ModelForm): self._errors["valeur_point_min"] = self.error_class([msg]) self._errors["valeur_point_max"] = self.error_class([msg]) raise forms.ValidationError("Les valeurs de point sont vides") - + + print cleaned_data.get("local") + if cleaned_data.get("local") is False and cleaned_data.get("expatrie") is False: + msg = "Le poste doit au moins être ouvert localement ou aux expatriés" + self._errors["local"] = self.error_class([msg]) + self._errors["expatrie"] = '' + raise forms.ValidationError(msg) + + return cleaned_data -- 1.7.10.4