From fbe238f40ff8c6a1ba4b6758c63cdf49e4cd71b1 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Wed, 13 Dec 2017 18:05:05 -0200 Subject: [PATCH] =?UTF-8?q?N=C3=A3o=20permite=20que=20ano=20e=20data=20em?= =?UTF-8?q?=20norma=20sejam=20dispares?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/norma/forms.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sapl/norma/forms.py b/sapl/norma/forms.py index fe4a77eb7..5207011a6 100644 --- a/sapl/norma/forms.py +++ b/sapl/norma/forms.py @@ -143,6 +143,13 @@ class NormaJuridicaForm(ModelForm): else: cleaned_data['materia'] = None + + ano = cleaned_data['ano'] + data = cleaned_data['data'] + + if data.year != ano: + raise ValidationError("O ano da norma não pode ser " + "diferente do ano no campo data") return cleaned_data def clean_texto_integral(self):