From d3c5015057c221fb96b7972c2cdf28b72d1eb62f Mon Sep 17 00:00:00 2001 From: ulyssesBML Date: Thu, 19 Dec 2019 12:37:55 -0300 Subject: [PATCH] =?UTF-8?q?Fix=20#3007=20-=20Adcionando=20mudan=C3=A7a=20d?= =?UTF-8?q?e=20apresenta=C3=A7=C3=A3o=20de=20oradores=20dependendo=20da=20?= =?UTF-8?q?materia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/painel/views.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sapl/painel/views.py b/sapl/painel/views.py index 1dcb7bb49..a00c2b8f4 100644 --- a/sapl/painel/views.py +++ b/sapl/painel/views.py @@ -21,7 +21,7 @@ from sapl.parlamentares.models import Legislatura, Parlamentar, Votante from sapl.sessao.models import (ExpedienteMateria, OradorExpediente, OrdemDia, PresencaOrdemDia, RegistroVotacao, SessaoPlenaria, SessaoPlenariaPresenca, - VotoParlamentar, RegistroLeitura) + VotoParlamentar, RegistroLeitura, OradorOrdemDia) from sapl.utils import filiacao_data, get_client_ip, sort_lista_chave from .models import Cronometro @@ -368,17 +368,21 @@ def get_presentes(pk, response, materia): sessao = SessaoPlenaria.objects.get(id=pk) num_presentes = len(presentes) data_sessao = sessao.data_inicio - oradores = OradorExpediente.objects.filter( - sessao_plenaria_id=pk).order_by('numero_ordem') - + + if type(materia) is ExpedienteMateria: + oradores = OradorExpediente.objects.filter( + sessao_plenaria_id=pk).order_by('numero_ordem') + else: + oradores = OradorOrdemDia.objects.filter( + sessao_plenaria_id=pk).order_by('numero_ordem') + oradores_list = [] for o in oradores: - oradores_list.append( { 'nome': o.parlamentar.nome_parlamentar, 'numero': o.numero_ordem - }) + }) presentes_list = [] for p in presentes: