From bcd05f043996c548fbdd705600203d50ace1a1ca Mon Sep 17 00:00:00 2001 From: ulyssesBML Date: Thu, 8 Oct 2020 13:35:32 -0300 Subject: [PATCH] =?UTF-8?q?Validando=20presen=C3=A7a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/sessao/views.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index c8a4009d6..aba038a70 100755 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -4134,12 +4134,19 @@ class LeituraEmBloco(PermissionRequiredForAppCrudMixin, TemplateView): logger = logging.getLogger(__name__) def post(self, request, *args, **kwargs): + if self.request.POST['origem'] == 'ordem': model = OrdemDia + presenca_model = PresencaOrdemDia else: model = ExpedienteMateria + presenca_model = SessaoPlenariaPresenca + spk = SessaoPlenaria.objects.get(pk=kwargs['pk']) + if not (verifica_presenca(request, presenca_model, spk, True)): + return HttpResponseRedirect(self.get_success_url()) + leituras = model.objects.filter( id__in=request.POST.getlist('marcadas_4')) @@ -4154,7 +4161,6 @@ class LeituraEmBloco(PermissionRequiredForAppCrudMixin, TemplateView): rl.save() ordem.save() - #import pdb; pdb.set_trace() return HttpResponseRedirect(self.get_success_url()) def get_success_url(self):