diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 831c28b96..805609b9b 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -420,7 +420,7 @@ class SessaoCrud(Crud): class PresencaMixin: - def get_parlamentares(self): + def get_presencas(self): self.object = self.get_object() presencas = SessaoPlenariaPresenca.objects.filter( @@ -434,6 +434,20 @@ class PresencaMixin: else: yield (parlamentar, False) + def get_presencas_ordem(self): + self.object = self.get_object() + + presencas = PresencaOrdemDia.objects.filter( + sessao_plenaria_id=self.object.id + ) + presentes = [p.parlamentar for p in presencas] + + for parlamentar in Parlamentar.objects.filter(ativo=True): + if parlamentar in presentes: + yield (parlamentar, True) + else: + yield (parlamentar, False) + class PresencaView(PermissionRequiredMixin, FormMixin, diff --git a/sapl/templates/sessao/presenca.html b/sapl/templates/sessao/presenca.html index 3cf93b505..3efb72734 100644 --- a/sapl/templates/sessao/presenca.html +++ b/sapl/templates/sessao/presenca.html @@ -14,7 +14,7 @@