From cd30c94e23d77a7de55b2fc4e14fcc9910ebbad9 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 14 Sep 2017 15:50:30 -0300 Subject: [PATCH] Adiciona checagem em clean() de ordemdia e maexpedientemateria --- sapl/sessao/forms.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sapl/sessao/forms.py b/sapl/sessao/forms.py index 656a0e1cc..a31aee70a 100644 --- a/sapl/sessao/forms.py +++ b/sapl/sessao/forms.py @@ -157,12 +157,11 @@ class ExpedienteMateriaForm(ModelForm): return self.instance.sessao_plenaria.data_inicio def clean(self): - super(ExpedienteMateriaForm, self).clean() + cleaned_data = super(ExpedienteMateriaForm, self).clean() - if self.errors: - return self.errors + if not self.is_valid(): + return cleaned_data - cleaned_data = self.cleaned_data sessao = self.instance.sessao_plenaria try: @@ -220,7 +219,9 @@ class OrdemDiaForm(ExpedienteMateriaForm): return self.cleaned_data['numero_ordem'] def clean(self): - super(OrdemDiaForm, self).clean() + cleaned_data = super(OrdemDiaForm, self).clean() + if not self.is_valid(): + return cleaned_data return self.cleaned_data def save(self, commit=False):