|
|
@ -13,6 +13,7 @@ from django.shortcuts import render |
|
|
from django.utils import timezone |
|
|
from django.utils import timezone |
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
|
|
|
|
|
|
|
|
|
from sapl import settings |
|
|
from sapl.base.models import AppConfig as ConfiguracoesAplicacao |
|
|
from sapl.base.models import AppConfig as ConfiguracoesAplicacao |
|
|
from sapl.base.models import CasaLegislativa |
|
|
from sapl.base.models import CasaLegislativa |
|
|
from sapl.crud.base import Crud |
|
|
from sapl.crud.base import Crud |
|
|
@ -23,6 +24,7 @@ from sapl.sessao.models import (ExpedienteMateria, OradorExpediente, OrdemDia, |
|
|
SessaoPlenaria, SessaoPlenariaPresenca, |
|
|
SessaoPlenaria, SessaoPlenariaPresenca, |
|
|
VotoParlamentar, RegistroLeitura) |
|
|
VotoParlamentar, RegistroLeitura) |
|
|
from sapl.utils import filiacao_data, get_client_ip, sort_lista_chave |
|
|
from sapl.utils import filiacao_data, get_client_ip, sort_lista_chave |
|
|
|
|
|
from image_cropping.utils import get_backend |
|
|
|
|
|
|
|
|
from .models import Cronometro |
|
|
from .models import Cronometro |
|
|
|
|
|
|
|
|
@ -402,10 +404,24 @@ def get_presentes(pk, response, materia): |
|
|
else: |
|
|
else: |
|
|
partido = filiacao |
|
|
partido = filiacao |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if p.parlamentar.fotografia: |
|
|
|
|
|
thumbnail_url = get_backend().get_thumbnail_url( |
|
|
|
|
|
p.parlamentar.fotografia, |
|
|
|
|
|
{ |
|
|
|
|
|
'size': (128, 128), |
|
|
|
|
|
'box': p.parlamentar.cropping, |
|
|
|
|
|
'crop': True, |
|
|
|
|
|
'detail': True, |
|
|
|
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
else: |
|
|
|
|
|
thumbnail_url = False |
|
|
presentes_list.append( |
|
|
presentes_list.append( |
|
|
{'id': p.id, |
|
|
{'id': p.id, |
|
|
'parlamentar_id': p.parlamentar.id, |
|
|
'parlamentar_id': p.parlamentar.id, |
|
|
'nome': p.parlamentar.nome_parlamentar, |
|
|
'nome': p.parlamentar.nome_parlamentar, |
|
|
|
|
|
'fotografia':thumbnail_url, |
|
|
'partido': partido, |
|
|
'partido': partido, |
|
|
'voto': '' |
|
|
'voto': '' |
|
|
}) |
|
|
}) |
|
|
|