Browse Source

Validando presença

pull/3294/head
ulyssesBML 4 years ago
parent
commit
bcd05f0439
  1. 8
      sapl/sessao/views.py

8
sapl/sessao/views.py

@ -4135,10 +4135,17 @@ class LeituraEmBloco(PermissionRequiredForAppCrudMixin, TemplateView):
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
if self.request.POST['origem'] == 'ordem': if self.request.POST['origem'] == 'ordem':
model = OrdemDia model = OrdemDia
presenca_model = PresencaOrdemDia
else: else:
model = ExpedienteMateria 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( leituras = model.objects.filter(
id__in=request.POST.getlist('marcadas_4')) id__in=request.POST.getlist('marcadas_4'))
@ -4154,7 +4161,6 @@ class LeituraEmBloco(PermissionRequiredForAppCrudMixin, TemplateView):
rl.save() rl.save()
ordem.save() ordem.save()
#import pdb; pdb.set_trace()
return HttpResponseRedirect(self.get_success_url()) return HttpResponseRedirect(self.get_success_url())
def get_success_url(self): def get_success_url(self):

Loading…
Cancel
Save