diff --git a/sapl/base/urls.py b/sapl/base/urls.py index 6108036ab..03b5b4eb3 100644 --- a/sapl/base/urls.py +++ b/sapl/base/urls.py @@ -4,7 +4,7 @@ from django.views.generic.base import TemplateView from .apps import AppConfig from .forms import LoginForm -from .views import CasaLegislativaCrud, HelpView, SistemaView +from .views import CasaLegislativaCrud, HelpView app_name = AppConfig.name diff --git a/sapl/materia/tests/test_materia.py b/sapl/materia/tests/test_materia.py index b8ad79280..f400a453e 100644 --- a/sapl/materia/tests/test_materia.py +++ b/sapl/materia/tests/test_materia.py @@ -1,18 +1,16 @@ import pytest - from django.contrib.auth.models import User from django.core.files.uploadedfile import SimpleUploadedFile from django.core.urlresolvers import reverse - from model_mommy import mommy + from sapl.comissoes.models import Comissao, TipoComissao from sapl.materia.models import (Anexada, Autor, Autoria, DespachoInicial, DocumentoAcessorio, MateriaLegislativa, - Numeracao, Proposicao, - RegimeTramitacao, StatusTramitacao, - TipoAutor, TipoProposicao, TipoDocumento, - TipoMateriaLegislativa, Tramitacao, - UnidadeTramitacao) + Numeracao, Proposicao, RegimeTramitacao, + StatusTramitacao, TipoAutor, TipoDocumento, + TipoMateriaLegislativa, TipoProposicao, + Tramitacao, UnidadeTramitacao) from sapl.norma.models import (LegislacaoCitada, NormaJuridica, TipoNormaJuridica) diff --git a/sapl/materia/urls.py b/sapl/materia/urls.py index 39d02776e..a0584d94d 100644 --- a/sapl/materia/urls.py +++ b/sapl/materia/urls.py @@ -34,7 +34,8 @@ urlpatterns = [ RelatoriaCrud.get_urls() + DocumentoAcessorioCrud.get_urls())), - url(r'^confirmar/(?P[0-9A-Za-z_\-]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})$', + url(r'''^confirmar/(?P[0-9A-Za-z_\-]+)/ + (?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})$''', ConfirmarEmailView.as_view(), name='confirmar_email'), url(r'^proposicao/', include(ProposicaoCrud.get_urls())), diff --git a/sapl/materia/views.py b/sapl/materia/views.py index f5aefc62c..35f4eef50 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -18,8 +18,7 @@ from django.template import Context, loader from django.utils.encoding import force_bytes from django.utils.http import urlsafe_base64_decode, urlsafe_base64_encode from django.utils.translation import ugettext_lazy as _ -from django.views.generic import (CreateView, DetailView, ListView, - TemplateView, UpdateView) +from django.views.generic import CreateView, ListView, TemplateView, UpdateView from django_filters.views import FilterView from sapl.base.models import CasaLegislativa diff --git a/sapl/parlamentares/views.py b/sapl/parlamentares/views.py index 93e49f120..e104cb91f 100644 --- a/sapl/parlamentares/views.py +++ b/sapl/parlamentares/views.py @@ -2,7 +2,6 @@ from django.contrib import messages from django.contrib.auth.mixins import PermissionRequiredMixin from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType -from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.core.urlresolvers import reverse_lazy from django.shortcuts import redirect from django.utils.datastructures import MultiValueDictKeyError @@ -10,8 +9,8 @@ from django.utils.translation import ugettext_lazy as _ from django.views.generic import FormView from sapl.crud.base import (Crud, CrudBaseMixin, CrudCreateView, - CrudDeleteView, CrudDetailView, - CrudListView, CrudUpdateView) + CrudDeleteView, CrudDetailView, CrudListView, + CrudUpdateView) from sapl.crud.masterdetail import MasterDetailCrud from sapl.utils import permissao_tb_aux, permissoes_parlamentares diff --git a/sapl/protocoloadm/views.py b/sapl/protocoloadm/views.py index ca549aba3..c6595f5fc 100644 --- a/sapl/protocoloadm/views.py +++ b/sapl/protocoloadm/views.py @@ -24,10 +24,9 @@ from sapl.utils import (create_barcode, get_client_ip, permissoes_adm, from .forms import (AnularProcoloAdmForm, DocumentoAcessorioAdministrativoForm, DocumentoAdministrativoFilterSet, - DocumentoAdministrativoForm, - ProtocoloDocumentForm, ProtocoloFilterSet, - ProtocoloMateriaForm, TramitacaoAdmEditForm, - TramitacaoAdmForm) + DocumentoAdministrativoForm, ProtocoloDocumentForm, + ProtocoloFilterSet, ProtocoloMateriaForm, + TramitacaoAdmEditForm, TramitacaoAdmForm) from .models import (Autor, DocumentoAcessorioAdministrativo, DocumentoAdministrativo, Protocolo, StatusTramitacaoAdministrativo, diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index 69fad9d7d..3578d6ec3 100644 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -53,7 +53,6 @@ def get_imagem(casa): if casa.logotipo: return casa.logotipo.path else: - # TODO: recuperar de uma variavel de sistema return STATIC_ROOT + '/img/brasao_transp.gif' diff --git a/sapl/sessao/forms.py b/sapl/sessao/forms.py index 6de9c622f..8b5845de2 100644 --- a/sapl/sessao/forms.py +++ b/sapl/sessao/forms.py @@ -13,7 +13,7 @@ from sapl.materia.forms import MateriaLegislativaFilterSet from sapl.materia.models import MateriaLegislativa, TipoMateriaLegislativa from sapl.utils import RANGE_DIAS_MES, RANGE_MESES, autor_label, autor_modal -from .models import Bancada, ExpedienteMateria, SessaoPlenaria, OrdemDia +from .models import Bancada, ExpedienteMateria, OrdemDia, SessaoPlenaria def pega_anos(): diff --git a/sapl/sessao/urls.py b/sapl/sessao/urls.py index a6b427628..0c1a5c424 100644 --- a/sapl/sessao/urls.py +++ b/sapl/sessao/urls.py @@ -1,11 +1,10 @@ from django.conf.urls import include, url from sapl.sessao.views import (AdicionarVariasMateriasExpediente, - AdicionarVariasMateriasOrdemDia, - BancadaCrud, CargoBancadaCrud, - ExpedienteMateriaCrud, ExpedienteView, - MateriaOrdemDiaCrud, MesaView, OradorCrud, - OradorExpedienteCrud, PainelView, + AdicionarVariasMateriasOrdemDia, BancadaCrud, + CargoBancadaCrud, ExpedienteMateriaCrud, + ExpedienteView, MateriaOrdemDiaCrud, MesaView, + OradorCrud, OradorExpedienteCrud, PainelView, PautaExpedienteDetail, PautaOrdemDetail, PautaSessaoDetailView, PautaSessaoListView, PesquisarSessaoPlenariaView, diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 8faef90f2..831c28b96 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -10,7 +10,7 @@ from django.http.response import HttpResponseRedirect from django.utils.datastructures import MultiValueDictKeyError from django.utils.html import strip_tags from django.utils.translation import ugettext_lazy as _ -from django.views.generic import FormView, ListView, TemplateView +from django.views.generic import ListView, TemplateView from django.views.generic.edit import FormMixin from django_filters.views import FilterView from rest_framework import generics @@ -20,18 +20,16 @@ from sapl.crud.base import (Crud, CrudBaseMixin, CrudCreateView, CrudUpdateView, make_pagination) from sapl.crud.masterdetail import MasterDetailCrud from sapl.materia.forms import pega_ultima_tramitacao -from sapl.materia.models import (Autoria, DocumentoAcessorio, - TipoMateriaLegislativa, Tramitacao) +from sapl.materia.models import Autoria, DocumentoAcessorio, Tramitacao from sapl.materia.views import MateriaLegislativaPesquisaView from sapl.norma.models import NormaJuridica from sapl.parlamentares.models import Parlamentar from sapl.sessao.serializers import SessaoPlenariaSerializer from sapl.utils import permissao_tb_aux, permissoes_painel, permissoes_sessao -from .forms import (AdicionarVariasMateriasFilterSet, - BancadaForm, ExpedienteForm, ExpedienteMateriaForm, - ListMateriaForm, MesaForm, - OrdemDiaForm, PresencaForm, +from .forms import (AdicionarVariasMateriasFilterSet, BancadaForm, + ExpedienteForm, ExpedienteMateriaForm, ListMateriaForm, + MesaForm, OrdemDiaForm, PresencaForm, SessaoPlenariaFilterSet, VotacaoEditForm, VotacaoForm, VotacaoNominalForm) from .models import (Bancada, CargoBancada, CargoMesa, ExpedienteMateria, @@ -2059,7 +2057,6 @@ class AdicionarVariasMateriasExpediente(MateriaLegislativaPesquisaView): return kwargs def get_context_data(self, **kwargs): - # import ipdb; ipdb.set_trace() context = super(MateriaLegislativaPesquisaView, self).get_context_data(**kwargs) diff --git a/sapl/utils.py b/sapl/utils.py index f7cbd2fa9..34aa2ce8c 100644 --- a/sapl/utils.py +++ b/sapl/utils.py @@ -262,7 +262,8 @@ def permissoes_parlamentares(): lista_permissoes = [] try: cts = ContentType.objects.filter(app_label='parlamentares') - perms_parlamentares = list(Permission.objects.filter(content_type__in=cts)) + perms_parlamentares = list(Permission.objects.filter( + content_type__in=cts)) for p in perms_parlamentares: lista_permissoes.append('parlamentares.' + p.codename) except: