From e400633985ba38ef360baa91e7613707a3dcde02 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 26 Nov 2019 15:03:11 -0300 Subject: [PATCH] HOT-FIX: refatora msg de erro de appconfig --- sapl/base/forms.py | 2 +- sapl/base/views.py | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/sapl/base/forms.py b/sapl/base/forms.py index 1e53c78df..d0aa5ca11 100644 --- a/sapl/base/forms.py +++ b/sapl/base/forms.py @@ -1495,7 +1495,7 @@ class ConfiguracoesAppForm(ModelForm): self.fields['cronometro_ordem'].widget.attrs['class'] = 'cronometro' self.fields['cronometro_consideracoes'].widget.attrs['class'] = 'cronometro' - def clean_mostrar_brasao_painel(self): + def clean(self): mostrar_brasao_painel = self.cleaned_data.get( 'mostrar_brasao_painel', False) casa = CasaLegislativa.objects.first() diff --git a/sapl/base/views.py b/sapl/base/views.py index 6004bb09f..44e68d9f9 100644 --- a/sapl/base/views.py +++ b/sapl/base/views.py @@ -1958,19 +1958,6 @@ class AppConfigCrud(CrudAux): self.gerar_hash(prop) return super().form_valid(form) - def form_invalid(self, form): - errors_tuple = [(form[e].label, form.errors[e]) - for e in form.errors if e in form.fields] - error_message = '' - - messages.add_message(self.request, messages.ERROR, error_message) - return super().form_invalid(form) - def gerar_hash(self, inst): inst.save() if inst.texto_original: @@ -1997,8 +1984,6 @@ class AppConfigCrud(CrudAux): reverse('sapl.base:appconfig_update', kwargs={'pk': app_config.pk})) - def post(self, request, *args, **kwargs): - return self.get(request, *args, **kwargs) class ListView(CrudAux.ListView):