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):