|
|
@ -360,9 +360,11 @@ def get_votos(response, materia): |
|
|
if type(materia) == OrdemDia: |
|
|
if type(materia) == OrdemDia: |
|
|
registro = RegistroVotacao.objects.filter( |
|
|
registro = RegistroVotacao.objects.filter( |
|
|
ordem=materia, materia=materia.materia).last() |
|
|
ordem=materia, materia=materia.materia).last() |
|
|
|
|
|
tipo = 'ordem' |
|
|
elif type(materia) == ExpedienteMateria: |
|
|
elif type(materia) == ExpedienteMateria: |
|
|
registro = RegistroVotacao.objects.filter( |
|
|
registro = RegistroVotacao.objects.filter( |
|
|
expediente=materia, materia=materia.materia).last() |
|
|
expediente=materia, materia=materia.materia).last() |
|
|
|
|
|
tipo = 'expediente' |
|
|
|
|
|
|
|
|
if not registro: |
|
|
if not registro: |
|
|
response.update({ |
|
|
response.update({ |
|
|
@ -374,6 +376,24 @@ def get_votos(response, materia): |
|
|
'tipo_resultado': 'Ainda não foi votada.', |
|
|
'tipo_resultado': 'Ainda não foi votada.', |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
if materia.tipo_votacao == 2: |
|
|
|
|
|
if tipo == 'ordem': |
|
|
|
|
|
votos_parlamentares = VotoParlamentar.objects.filter( |
|
|
|
|
|
ordem_id=materia.id).order_by( |
|
|
|
|
|
'parlamentar__nome_parlamentar') |
|
|
|
|
|
else: |
|
|
|
|
|
votos_parlamentares = VotoParlamentar.objects.filter( |
|
|
|
|
|
expediente_id=materia.id).order_by( |
|
|
|
|
|
'parlamentar__nome_parlamentar') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for i, p in enumerate(response['presentes']): |
|
|
|
|
|
try: |
|
|
|
|
|
if votos_parlamentares.get(parlamentar_id=p['parlamentar_id']).voto: |
|
|
|
|
|
response['presentes'][i]['voto'] = 'Voto Informado' |
|
|
|
|
|
except ObjectDoesNotExist: |
|
|
|
|
|
response['presentes'][i]['voto'] = '' |
|
|
|
|
|
|
|
|
else: |
|
|
else: |
|
|
total = (registro.numero_votos_sim + |
|
|
total = (registro.numero_votos_sim + |
|
|
registro.numero_votos_nao + |
|
|
registro.numero_votos_nao + |
|
|
|