From f90bb453b65402d37632067691646afd2a461295 Mon Sep 17 00:00:00 2001 From: ulyssesBML Date: Mon, 13 Jul 2020 12:23:43 -0300 Subject: [PATCH] =?UTF-8?q?Adicionando=20recomenda=C3=A7=C3=B5es=20de=20co?= =?UTF-8?q?digo=20feitas=20no=20PR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/painel/views.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sapl/painel/views.py b/sapl/painel/views.py index f5c92aedf..862e9dc3d 100644 --- a/sapl/painel/views.py +++ b/sapl/painel/views.py @@ -358,25 +358,26 @@ def get_materia_aberta(pk): def get_presentes(pk, response, materia): + ModelPresenca = None if isinstance(materia, OrdemDia): - presentes = PresencaOrdemDia.objects.filter( - sessao_plenaria_id=pk) + ModelPresenca = PresencaOrdemDia else: - presentes = SessaoPlenariaPresenca.objects.filter( + ModelPresenca = SessaoPlenariaPresenca + + presentes = ModelPresenca.objects.filter( sessao_plenaria_id=pk) sessao = SessaoPlenaria.objects.get(id=pk) num_presentes = len(presentes) data_sessao = sessao.data_inicio + ModelOrador = None if isinstance(materia, ExpedienteMateria): - oradores = OradorExpediente.objects.filter( - sessao_plenaria_id=pk).order_by('numero_ordem') + ModelOrador = OradorExpediente elif isinstance(materia, OrdemDia): - oradores = OradorOrdemDia.objects.filter( + ModelOrador = OradorOrdemDia + oradores = ModelOrador.objects.filter( sessao_plenaria_id=pk).order_by('numero_ordem') - else: - oradores = [] oradores_list = [] for o in oradores: