@ -76,13 +76,14 @@ class RedirecionaSAPLIndex(RedirectView):
logger = logging . getLogger ( __name__ )
logger = logging . getLogger ( __name__ )
def get_redirect_url ( self ) :
def get_redirect_url ( self ) :
url_pattern = ' sapl_index '
url_pattern = ' sapl.base:sapl _index '
username = self . request . user . username
username = self . request . user . username
try :
try :
self . logger . info ( " user= " + username + " . Tentando obter url. " )
self . logger . info ( " user= " + username + " . Tentando obter url. " )
url = reverse ( url_pattern )
url = reverse ( url_pattern )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( url_pattern )
raise UnknownUrlNameError ( url_pattern )
url = has_iframe ( url , self . request )
url = has_iframe ( url , self . request )
@ -105,17 +106,20 @@ class RedirecionaParlamentar(RedirectView):
if pk_parlamentar :
if pk_parlamentar :
try :
try :
kwargs = { ' pk ' : pk_parlamentar }
kwargs = { ' pk ' : pk_parlamentar }
self . logger . debug ( " user= " + username + " . Tentando obter url correspondente. " )
self . logger . debug ( " user= " + username +
" . Tentando obter url correspondente. " )
url = reverse ( parlamentar_detail , kwargs = kwargs )
url = reverse ( parlamentar_detail , kwargs = kwargs )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( parlamentar_detail , kwargs = kwargs )
raise UnknownUrlNameError ( parlamentar_detail , kwargs = kwargs )
else :
else :
try :
try :
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
url = reverse ( parlamentar_list )
url = reverse ( parlamentar_list )
except NoReverseMatch :
except NoReverseMatch :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( parlamentar_list )
raise UnknownUrlNameError ( parlamentar_list )
numero_legislatura = self . request . GET . get (
numero_legislatura = self . request . GET . get (
@ -143,17 +147,20 @@ class RedirecionaComissao(RedirectView):
kwargs = { ' pk ' : pk_comissao }
kwargs = { ' pk ' : pk_comissao }
try :
try :
self . logger . debug ( " user= " + username + " . Tentando obter url correspondente. " )
self . logger . debug ( " user= " + username +
" . Tentando obter url correspondente. " )
url = reverse ( comissao_detail , kwargs = kwargs )
url = reverse ( comissao_detail , kwargs = kwargs )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( comissao_detail )
raise UnknownUrlNameError ( comissao_detail )
else :
else :
try :
try :
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
url = reverse ( comissao_list )
url = reverse ( comissao_list )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( comissao_list )
raise UnknownUrlNameError ( comissao_list )
url = has_iframe ( url , self . request )
url = has_iframe ( url , self . request )
@ -176,17 +183,20 @@ class RedirecionaComposicaoComissao(RedirectView):
kwargs = { ' pk ' : pk_comissao }
kwargs = { ' pk ' : pk_comissao }
try :
try :
self . logger . debug ( " user= " + username + " . Tentando obter url correspondente. " )
self . logger . debug ( " user= " + username +
" . Tentando obter url correspondente. " )
url = reverse ( comissao_detail , kwargs = kwargs )
url = reverse ( comissao_detail , kwargs = kwargs )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( comissao_detail )
raise UnknownUrlNameError ( comissao_detail )
else :
else :
try :
try :
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
url = reverse ( comissao_list )
url = reverse ( comissao_list )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( comissao_list )
raise UnknownUrlNameError ( comissao_list )
url = has_iframe ( url , self . request )
url = has_iframe ( url , self . request )
@ -208,17 +218,20 @@ class RedirecionaPautaSessao(RedirectView):
if pk_sessao_plenaria :
if pk_sessao_plenaria :
kwargs = { ' pk ' : pk_sessao_plenaria }
kwargs = { ' pk ' : pk_sessao_plenaria }
try :
try :
self . logger . debug ( " user= " + username + " . Tentando obter url correspondente. " )
self . logger . debug ( " user= " + username +
" . Tentando obter url correspondente. " )
url = reverse ( pauta_sessao_detail , kwargs = kwargs )
url = reverse ( pauta_sessao_detail , kwargs = kwargs )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( pauta_sessao_detail )
raise UnknownUrlNameError ( pauta_sessao_detail )
else :
else :
try :
try :
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
url = reverse ( pauta_sessao_list )
url = reverse ( pauta_sessao_list )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( pauta_sessao_list )
raise UnknownUrlNameError ( pauta_sessao_list )
data_sessao_plenaria = self . request . GET . get (
data_sessao_plenaria = self . request . GET . get (
@ -255,10 +268,12 @@ class RedirecionaSessaoPlenaria(RedirectView):
if pk_sessao_plenaria :
if pk_sessao_plenaria :
kwargs = { ' pk ' : pk_sessao_plenaria }
kwargs = { ' pk ' : pk_sessao_plenaria }
try :
try :
self . logger . debug ( " user= " + username + " . Tentando obter url correspondente. " )
self . logger . debug ( " user= " + username +
" . Tentando obter url correspondente. " )
url = reverse ( sessao_plenaria_detail , kwargs = kwargs )
url = reverse ( sessao_plenaria_detail , kwargs = kwargs )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( sessao_plenaria_detail )
raise UnknownUrlNameError ( sessao_plenaria_detail )
else :
else :
@ -266,7 +281,8 @@ class RedirecionaSessaoPlenaria(RedirectView):
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
url = reverse ( sessao_plenaria_list )
url = reverse ( sessao_plenaria_list )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( sessao_plenaria_list )
raise UnknownUrlNameError ( sessao_plenaria_list )
year = self . request . GET . get (
year = self . request . GET . get (
@ -309,7 +325,8 @@ class RedirecionaRelatoriosList(RedirectView):
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
url = reverse ( relatorios_list )
url = reverse ( relatorios_list )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( relatorios_list )
raise UnknownUrlNameError ( relatorios_list )
url = has_iframe ( url , self . request )
url = has_iframe ( url , self . request )
@ -328,7 +345,8 @@ class RedirecionaRelatoriosMateriasEmTramitacaoList(RedirectView):
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
url = reverse ( relatorio_materia_por_tramitacao )
url = reverse ( relatorio_materia_por_tramitacao )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( relatorio_materia_por_tramitacao )
raise UnknownUrlNameError ( relatorio_materia_por_tramitacao )
year = self . request . GET . get (
year = self . request . GET . get (
@ -396,7 +414,8 @@ class RedirecionaMateriaLegislativaList(RedirectView):
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
url = reverse ( materialegislativa_list )
url = reverse ( materialegislativa_list )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( materialegislativa_list )
raise UnknownUrlNameError ( materialegislativa_list )
tipo_materia = self . request . GET . get (
tipo_materia = self . request . GET . get (
@ -475,7 +494,8 @@ class RedirecionaMesaDiretoraView(RedirectView):
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
url = reverse ( parlamentar_mesa_diretora )
url = reverse ( parlamentar_mesa_diretora )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( parlamentar_mesa_diretora )
raise UnknownUrlNameError ( parlamentar_mesa_diretora )
url = has_iframe ( url , self . request )
url = has_iframe ( url , self . request )
@ -509,12 +529,14 @@ class RedirecionaNormasJuridicasTextoIntegral(RedirectView):
url = EMPTY_STRING
url = EMPTY_STRING
username = self . request . user . username
username = self . request . user . username
try :
try :
self . logger . debug ( " user= " + username + " . Tentando obter NormaJuridica com pk= {} . " . format ( kwargs [ ' norma_id ' ] ) )
self . logger . debug (
" user= " + username + " . Tentando obter NormaJuridica com pk= {} . " . format ( kwargs [ ' norma_id ' ] ) )
norma = NormaJuridica . objects . get ( pk = kwargs [ ' norma_id ' ] )
norma = NormaJuridica . objects . get ( pk = kwargs [ ' norma_id ' ] )
if norma :
if norma :
url = norma . texto_integral . url
url = norma . texto_integral . url
except Exception as e :
except Exception as e :
self . logger . error ( " user= " + username + " . Erro ao obter NormaJuridica com pk= {} . " . format ( kwargs [ ' norma_id ' ] ) + str ( e ) )
self . logger . error (
" user= " + username + " . Erro ao obter NormaJuridica com pk= {} . " . format ( kwargs [ ' norma_id ' ] ) + str ( e ) )
raise e
raise e
url = has_iframe ( url , self . request )
url = has_iframe ( url , self . request )
@ -535,7 +557,8 @@ class RedirecionaNormasJuridicasList(RedirectView):
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
url = reverse ( norma_juridica_pesquisa )
url = reverse ( norma_juridica_pesquisa )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( norma_juridica_pesquisa )
raise UnknownUrlNameError ( norma_juridica_pesquisa )
tipo_norma = self . request . GET . get (
tipo_norma = self . request . GET . get (
@ -598,7 +621,8 @@ class RedirecionaHistoricoTramitacoesList(RedirectView):
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
url = reverse ( historico_tramitacoes )
url = reverse ( historico_tramitacoes )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( historico_tramitacoes )
raise UnknownUrlNameError ( historico_tramitacoes )
inicio_intervalo_data_tramitacao = self . request . GET . get (
inicio_intervalo_data_tramitacao = self . request . GET . get (
@ -660,7 +684,8 @@ class RedirecionaAtasList(RedirectView):
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
url = reverse ( pesquisar_atas )
url = reverse ( pesquisar_atas )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( pesquisar_atas )
raise UnknownUrlNameError ( pesquisar_atas )
inicio_intervalo_data_ata = self . request . GET . get (
inicio_intervalo_data_ata = self . request . GET . get (
@ -699,7 +724,8 @@ class RedirecionaPresencaParlamentares(RedirectView):
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
url = reverse ( presenca_sessao )
url = reverse ( presenca_sessao )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( presenca_sessao )
raise UnknownUrlNameError ( presenca_sessao )
inicio_intervalo_data_presenca_parlamentar = self . request . GET . get (
inicio_intervalo_data_presenca_parlamentar = self . request . GET . get (
@ -736,7 +762,8 @@ class RedirecionaMateriasPorAutor(RedirectView):
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
url = reverse ( relatorio_materia_por_autor )
url = reverse ( relatorio_materia_por_autor )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( relatorio_materia_por_autor )
raise UnknownUrlNameError ( relatorio_materia_por_autor )
url = has_iframe ( url , self . request )
url = has_iframe ( url , self . request )
@ -758,7 +785,8 @@ class RedirecionaMateriasPorAnoAutorTipo(RedirectView):
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
url = reverse ( relatorio_materia_por_ano_autor_tipo )
url = reverse ( relatorio_materia_por_ano_autor_tipo )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( relatorio_materia_por_ano_autor_tipo )
raise UnknownUrlNameError ( relatorio_materia_por_ano_autor_tipo )
if ano :
if ano :
@ -785,10 +813,12 @@ class RedirecionaReuniao(RedirectView):
if pk_reuniao :
if pk_reuniao :
kwargs = { ' pk ' : pk_reuniao }
kwargs = { ' pk ' : pk_reuniao }
try :
try :
self . logger . debug ( " user= " + username + " . Tentando obter url correspondente (pk= {} ). " . format ( kwargs [ ' pk ' ] ) )
self . logger . debug (
" user= " + username + " . Tentando obter url correspondente (pk= {} ). " . format ( kwargs [ ' pk ' ] ) )
url = reverse ( reuniao_detail , kwargs = kwargs )
url = reverse ( reuniao_detail , kwargs = kwargs )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( reuniao_detail )
raise UnknownUrlNameError ( reuniao_detail )
else :
else :
@ -796,7 +826,8 @@ class RedirecionaReuniao(RedirectView):
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
self . logger . debug ( " user= " + username + " . Tentando obter url. " )
url = reverse ( reuniao_list )
url = reverse ( reuniao_list )
except NoReverseMatch as e :
except NoReverseMatch as e :
self . logger . error ( " user= " + username + " . Erro ao obter url. " + str ( e ) )
self . logger . error ( " user= " + username +
" . Erro ao obter url. " + str ( e ) )
raise UnknownUrlNameError ( reuniao_list )
raise UnknownUrlNameError ( reuniao_list )
year = self . request . GET . get (
year = self . request . GET . get (