From 4bfa09382460e8b11a1b8e1d17fa3086e2d6fc67 Mon Sep 17 00:00:00 2001 From: Mariana Mendes Date: Fri, 28 Sep 2018 11:58:59 -0300 Subject: [PATCH] fix #1801 --- sapl/sessao/forms.py | 8 +++++--- sapl/sessao/views.py | 6 ------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/sapl/sessao/forms.py b/sapl/sessao/forms.py index 9ecd11f5a..1bf358987 100644 --- a/sapl/sessao/forms.py +++ b/sapl/sessao/forms.py @@ -679,13 +679,15 @@ class ResumoOrdenacaoForm(forms.Form): -class JustificativaAusenciaForm(forms.Form): +class JustificativaAusenciaForm(ModelForm): + class Meta: model = JustificativaAusencia fields = ['sessao_plenaria', 'tipo_ausencia', 'hora', 'data'] def clean(self): - cleaned_data = super(JustificativaAusenciaForm, self).clean() + super(JustificativaAusenciaForm, self).clean() + if not self.is_valid(): - return cleaned_data \ No newline at end of file + return self.cleaned_data \ No newline at end of file diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 2d823a6e3..d9545f8bd 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -2955,9 +2955,3 @@ class JustificativaAusenciaCrud(Crud): class DeleteView(Crud.DeleteView): pass - class DetailView(Crud.DetailView): - - layout_key = 'JustificativaAusenciaDetail' - - def get(self, request, *args, **kwargs): - return super().get(request, *args, **kwargs) \ No newline at end of file