From 366c95eec9ca1fb6718afbba69b7a400e7142de0 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 5 Dec 2019 13:10:13 -0300 Subject: [PATCH] HOT-FIX: conserta bug introduzido em e400633985 --- sapl/base/forms.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sapl/base/forms.py b/sapl/base/forms.py index f949faf5d..22179991b 100644 --- a/sapl/base/forms.py +++ b/sapl/base/forms.py @@ -1328,9 +1328,14 @@ class ConfiguracoesAppForm(ModelForm): 'tramitacao_materia', 'tramitacao_documento'] - def clean_mostrar_brasao_painel(self): - mostrar_brasao_painel = self.cleaned_data.get( - 'mostrar_brasao_painel', False) + + def clean(self): + cleaned_data = super().clean() + + if not self.is_valid(): + return cleaned_data + + mostrar_brasao_painel = self.cleaned_data.get('mostrar_brasao_painel', False) casa = CasaLegislativa.objects.first() if not casa: @@ -1343,7 +1348,7 @@ class ConfiguracoesAppForm(ModelForm): raise ValidationError("Não há logitipo configurado para esta " "Casa legislativa.") - return mostrar_brasao_painel + return cleaned_data class RecuperarSenhaForm(PasswordResetForm):