From 8a3b29506b80bd5eac9af75ac026860ccb7c581d Mon Sep 17 00:00:00 2001 From: ulyssesBML Date: Mon, 20 Jan 2020 16:50:15 -0300 Subject: [PATCH] Colocando melhorias relatadas no PR --- sapl/painel/views.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sapl/painel/views.py b/sapl/painel/views.py index a00c2b8f4..f5c92aedf 100644 --- a/sapl/painel/views.py +++ b/sapl/painel/views.py @@ -358,7 +358,7 @@ def get_materia_aberta(pk): def get_presentes(pk, response, materia): - if type(materia) == OrdemDia: + if isinstance(materia, OrdemDia): presentes = PresencaOrdemDia.objects.filter( sessao_plenaria_id=pk) else: @@ -369,13 +369,15 @@ def get_presentes(pk, response, materia): num_presentes = len(presentes) data_sessao = sessao.data_inicio - if type(materia) is ExpedienteMateria: + if isinstance(materia, ExpedienteMateria): oradores = OradorExpediente.objects.filter( sessao_plenaria_id=pk).order_by('numero_ordem') - else: + elif isinstance(materia, OrdemDia): oradores = OradorOrdemDia.objects.filter( sessao_plenaria_id=pk).order_by('numero_ordem') - + else: + oradores = [] + oradores_list = [] for o in oradores: oradores_list.append(