From 2cca1c67bce9a22f9eaf441cf82514a2418d57b5 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 21 Nov 2017 15:03:38 -0200 Subject: [PATCH] =?UTF-8?q?Descreve=20o=20tipo=20de=20mat=C3=A9ria=20quand?= =?UTF-8?q?o=20inexistente=20no=20cadastro=20de=20norma?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/norma/forms.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sapl/norma/forms.py b/sapl/norma/forms.py index f5be3f918..1ea6812fd 100644 --- a/sapl/norma/forms.py +++ b/sapl/norma/forms.py @@ -131,11 +131,13 @@ class NormaJuridicaForm(ModelForm): tipo_id=cleaned_data['tipo_materia'], numero=cleaned_data['numero_materia'], ano=cleaned_data['ano_materia']) + except ObjectDoesNotExist: raise forms.ValidationError( - _("Matéria %s/%s é inexistente." % ( + _("Matéria Legislativa %s/%s (%s) é inexistente." % ( self.cleaned_data['numero_materia'], - self.cleaned_data['ano_materia']))) + self.cleaned_data['ano_materia'], + cleaned_data['tipo_materia'].descricao))) else: cleaned_data['materia'] = materia