|
|
@ -283,12 +283,13 @@ def get_presentes(pk, response, materia): |
|
|
if type(materia) == OrdemDia: |
|
|
if type(materia) == OrdemDia: |
|
|
presentes = PresencaOrdemDia.objects.filter( |
|
|
presentes = PresencaOrdemDia.objects.filter( |
|
|
sessao_plenaria_id=pk) |
|
|
sessao_plenaria_id=pk) |
|
|
elif type(materia) == ExpedienteMateria: |
|
|
else: |
|
|
presentes = SessaoPlenariaPresenca.objects.filter( |
|
|
presentes = SessaoPlenariaPresenca.objects.filter( |
|
|
sessao_plenaria_id=pk) |
|
|
sessao_plenaria_id=pk) |
|
|
|
|
|
|
|
|
|
|
|
sessao = SessaoPlenaria.objects.get(id=pk) |
|
|
num_presentes = len(presentes) |
|
|
num_presentes = len(presentes) |
|
|
data_sessao = materia.sessao_plenaria.data_inicio |
|
|
data_sessao = sessao.data_inicio |
|
|
|
|
|
|
|
|
presentes_list = [] |
|
|
presentes_list = [] |
|
|
for p in presentes: |
|
|
for p in presentes: |
|
|
@ -307,22 +308,27 @@ def get_presentes(pk, response, materia): |
|
|
'voto': '' |
|
|
'voto': '' |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
if materia.tipo_votacao == 1: |
|
|
if materia: |
|
|
tipo_votacao = 'Simbólica' |
|
|
if materia.tipo_votacao == 1: |
|
|
elif materia.tipo_votacao == 2: |
|
|
tipo_votacao = 'Simbólica' |
|
|
tipo_votacao = 'Nominal' |
|
|
elif materia.tipo_votacao == 2: |
|
|
elif materia.tipo_votacao == 3: |
|
|
tipo_votacao = 'Nominal' |
|
|
tipo_votacao = 'Secreta' |
|
|
elif materia.tipo_votacao == 3: |
|
|
|
|
|
tipo_votacao = 'Secreta' |
|
|
|
|
|
|
|
|
|
|
|
response.update({ |
|
|
|
|
|
'tipo_resultado': materia.resultado, |
|
|
|
|
|
'observacao_materia': materia.observacao, |
|
|
|
|
|
'tipo_votacao': tipo_votacao, |
|
|
|
|
|
'materia_legislativa_texto': str(materia.materia) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
response.update({ |
|
|
response.update({ |
|
|
'presentes': presentes_list, |
|
|
'presentes': presentes_list, |
|
|
'num_presentes': num_presentes, |
|
|
'num_presentes': num_presentes, |
|
|
'status_painel': 'ABERTO', |
|
|
|
|
|
'msg_painel': str(_('Votação aberta!')), |
|
|
'msg_painel': str(_('Votação aberta!')), |
|
|
'tipo_resultado': materia.resultado, |
|
|
}) |
|
|
'tipo_votacao': tipo_votacao, |
|
|
|
|
|
'observacao_materia': materia.observacao, |
|
|
|
|
|
'materia_legislativa_texto': str(materia.materia)}) |
|
|
|
|
|
|
|
|
|
|
|
return response |
|
|
return response |
|
|
|
|
|
|
|
|
@ -334,7 +340,6 @@ def get_materia_expediente_aberta(pk): |
|
|
|
|
|
|
|
|
def response_nenhuma_materia(response): |
|
|
def response_nenhuma_materia(response): |
|
|
response.update({ |
|
|
response.update({ |
|
|
'status_painel': 'FECHADO', |
|
|
|
|
|
'msg_painel': str(_('Nenhuma matéria disponivel para votação.'))}) |
|
|
'msg_painel': str(_('Nenhuma matéria disponivel para votação.'))}) |
|
|
return JsonResponse(response) |
|
|
return JsonResponse(response) |
|
|
|
|
|
|
|
|
@ -397,6 +402,7 @@ def get_dados_painel(request, pk): |
|
|
'cronometro_aparte': get_cronometro_status(request, 'aparte'), |
|
|
'cronometro_aparte': get_cronometro_status(request, 'aparte'), |
|
|
'cronometro_discurso': get_cronometro_status(request, 'discurso'), |
|
|
'cronometro_discurso': get_cronometro_status(request, 'discurso'), |
|
|
'cronometro_ordem': get_cronometro_status(request, 'ordem'), |
|
|
'cronometro_ordem': get_cronometro_status(request, 'ordem'), |
|
|
|
|
|
'status_painel': sessao.painel_aberto |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ordem_dia = get_materia_aberta(pk) |
|
|
ordem_dia = get_materia_aberta(pk) |
|
|
@ -445,4 +451,4 @@ def get_dados_painel(request, pk): |
|
|
materia)) |
|
|
materia)) |
|
|
|
|
|
|
|
|
# Retorna que não há nenhuma matéria já votada ou aberta |
|
|
# Retorna que não há nenhuma matéria já votada ou aberta |
|
|
return response_nenhuma_materia(response) |
|
|
return response_nenhuma_materia(get_presentes(pk, response, None)) |
|
|
|