Browse Source

Corrige problemas de PEP 8

pull/1461/head
Marcio Mazza 7 years ago
parent
commit
14615b647d
  1. 3
      sapl/compilacao/tests/test_tipo_texto_articulado_form.py
  2. 1
      sapl/materia/forms.py
  3. 2
      sapl/materia/models.py
  4. 2
      sapl/materia/urls.py
  5. 17
      sapl/materia/views.py
  6. 4
      sapl/norma/tests/test_norma.py
  7. 2
      sapl/norma/views.py
  8. 2
      sapl/parlamentares/tests/test_parlamentares.py
  9. 2
      sapl/parlamentares/views.py
  10. 5
      sapl/protocoloadm/forms.py
  11. 3
      sapl/protocoloadm/tests/test_protocoloadm.py
  12. 5
      sapl/protocoloadm/views.py

3
sapl/compilacao/tests/test_tipo_texto_articulado_form.py

@ -3,8 +3,7 @@ from django.utils.translation import ugettext as _
from model_mommy import mommy
from sapl.compilacao import forms
from sapl.compilacao.models import (PerfilEstruturalTextoArticulado,
TipoNota)
from sapl.compilacao.models import PerfilEstruturalTextoArticulado, TipoNota
from sapl.compilacao.views import choice_models_in_extenal_views

1
sapl/materia/forms.py

@ -1678,4 +1678,3 @@ class EtiquetaPesquisaForm(forms.Form):
'O processo final não pode ser menor que o inicial'))
return cleaned_data

2
sapl/materia/models.py

@ -803,7 +803,7 @@ class UnidadeTramitacao(models.Model):
class Meta:
verbose_name = _('Unidade de Tramitação')
verbose_name_plural = _('Unidades de Tramitação')
ordering = ['orgao','comissao','parlamentar']
ordering = ['orgao', 'comissao', 'parlamentar']
def __str__(self):
if self.orgao and self.comissao and self.parlamentar:

2
sapl/materia/urls.py

@ -8,7 +8,7 @@ from sapl.materia.views import (AcompanhamentoConfirmarView,
CriarProtocoloMateriaView, DespachoInicialCrud,
DocumentoAcessorioCrud,
DocumentoAcessorioEmLoteView,
ImpressosView, EtiquetaPesquisaView,
EtiquetaPesquisaView, ImpressosView,
LegislacaoCitadaCrud, MateriaAssuntoCrud,
MateriaLegislativaCrud,
MateriaLegislativaPesquisaView, MateriaTaView,

17
sapl/materia/views.py

@ -12,7 +12,7 @@ from django.core.urlresolvers import reverse
from django.http import HttpResponse, JsonResponse
from django.http.response import Http404, HttpResponseRedirect
from django.shortcuts import get_object_or_404, redirect
from django.template import Context, loader, RequestContext
from django.template import Context, RequestContext, loader
from django.utils import formats
from django.utils.translation import ugettext_lazy as _
from django.views.generic import CreateView, ListView, TemplateView, UpdateView
@ -21,6 +21,7 @@ from django.views.generic.edit import FormView
from django_filters.views import FilterView
import sapl
import weasyprint
from sapl.base.models import Autor, CasaLegislativa
from sapl.comissoes.models import Comissao, Participacao
from sapl.compilacao.models import (STATUS_TA_IMMUTABLE_RESTRICT,
@ -46,11 +47,10 @@ from .email_utils import do_envia_email_confirmacao
from .forms import (AcessorioEmLoteFilterSet, AcompanhamentoMateriaForm,
AdicionarVariasAutoriasFilterSet, DespachoInicialForm,
DocumentoAcessorioForm, EtiquetaPesquisaForm,
MateriaAssuntoForm,
MateriaLegislativaFilterSet, MateriaSimplificadaForm,
PrimeiraTramitacaoEmLoteFilterSet, ReceberProposicaoForm,
RelatoriaForm, TramitacaoEmLoteFilterSet,
filtra_tramitacao_destino,
MateriaAssuntoForm, MateriaLegislativaFilterSet,
MateriaSimplificadaForm, PrimeiraTramitacaoEmLoteFilterSet,
ReceberProposicaoForm, RelatoriaForm,
TramitacaoEmLoteFilterSet, filtra_tramitacao_destino,
filtra_tramitacao_destino_and_status,
filtra_tramitacao_status)
from .models import (AcompanhamentoMateria, Anexada, AssuntoMateria, Autoria,
@ -61,8 +61,6 @@ from .models import (AcompanhamentoMateria, Anexada, AssuntoMateria, Autoria,
TipoProposicao, Tramitacao, UnidadeTramitacao)
from .signals import tramitacao_signal
import weasyprint
AssuntoMateriaCrud = Crud.build(AssuntoMateria, 'assunto_materia')
OrigemCrud = Crud.build(Origem, '')
@ -1751,6 +1749,7 @@ class ImpressosView(PermissionRequiredMixin, TemplateView):
template_name = 'materia/impressos/impressos.html'
permission_required = ('materia.can_access_impressos', )
def gerar_pdf_impressos(request, context):
template = loader.get_template('materia/impressos/pdf.html')
html = template.render(RequestContext(request, context))
@ -1797,5 +1796,3 @@ class EtiquetaPesquisaView(PermissionRequiredMixin, FormView):
context['materias'] = materias
return gerar_pdf_impressos(self.request, context)

4
sapl/norma/tests/test_norma.py

@ -1,13 +1,11 @@
import pytest
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from model_mommy import mommy
from sapl.materia.models import MateriaLegislativa, TipoMateriaLegislativa
from sapl.norma.forms import NormaJuridicaForm, NormaRelacionadaForm
from sapl.norma.models import (NormaJuridica, TipoNormaJuridica)
from sapl.norma.models import NormaJuridica, TipoNormaJuridica
@pytest.mark.django_db(transaction=False)

2
sapl/norma/views.py

@ -1,4 +1,5 @@
from datetime import datetime
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.http import JsonResponse
@ -146,7 +147,6 @@ class NormaCrud(Crud):
def layout_key(self):
return 'NormaJuridicaCreate'
class ListView(Crud.ListView, RedirectView):
def get_redirect_url(self, *args, **kwargs):

2
sapl/parlamentares/tests/test_parlamentares.py

@ -3,7 +3,7 @@ from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from model_mommy import mommy
from sapl.parlamentares.forms import (FrenteForm, LegislaturaForm, MandatoForm)
from sapl.parlamentares.forms import FrenteForm, LegislaturaForm, MandatoForm
from sapl.parlamentares.models import (Dependente, Filiacao, Legislatura,
Mandato, Parlamentar, Partido,
TipoDependente)

2
sapl/parlamentares/views.py

@ -1,5 +1,5 @@
from datetime import datetime
import json
from datetime import datetime
from django.contrib import messages
from django.contrib.contenttypes.models import ContentType

5
sapl/protocoloadm/forms.py

@ -1,5 +1,6 @@
from datetime import datetime
import django_filters
from crispy_forms.bootstrap import InlineRadios
from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, Button, Fieldset, Layout, Submit
@ -8,10 +9,9 @@ from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db import models
from django.forms import ModelForm
from django.utils.translation import ugettext_lazy as _
import django_filters
from sapl.base.models import Autor, TipoAutor
from sapl.crispy_layout_mixin import form_actions, to_row, SaplFormLayout
from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row
from sapl.materia.models import (MateriaLegislativa, TipoMateriaLegislativa,
UnidadeTramitacao)
from sapl.utils import (RANGE_ANOS, AnoNumeroOrderingFilter,
@ -21,7 +21,6 @@ from .models import (DocumentoAcessorioAdministrativo, DocumentoAdministrativo,
Protocolo, TipoDocumentoAdministrativo,
TramitacaoAdministrativo)
TIPOS_PROTOCOLO = [('0', 'Recebido'), ('1', 'Enviado'), ('', 'Ambos')]
TIPOS_PROTOCOLO_CREATE = [('0', 'Recebido'), ('1', 'Enviado')]

3
sapl/protocoloadm/tests/test_protocoloadm.py

@ -9,8 +9,7 @@ from model_mommy import mommy
from sapl.materia.models import UnidadeTramitacao
from sapl.protocoloadm.forms import (AnularProcoloAdmForm,
DocumentoAdministrativoForm,
MateriaLegislativa,
ProtocoloDocumentForm,
MateriaLegislativa, ProtocoloDocumentForm,
ProtocoloMateriaForm)
from sapl.protocoloadm.models import (DocumentoAdministrativo, Protocolo,
StatusTramitacaoAdministrativo,

5
sapl/protocoloadm/views.py

@ -11,9 +11,10 @@ from django.http import Http404, HttpResponse, JsonResponse
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from django.views.generic import CreateView, ListView
from django.views.generic.base import TemplateView, RedirectView
from django.views.generic.base import RedirectView, TemplateView
from django_filters.views import FilterView
import sapl
from sapl.base.models import Autor
from sapl.comissoes.models import Comissao
from sapl.crud.base import Crud, CrudAux, MasterDetailCrud, make_pagination
@ -21,7 +22,6 @@ from sapl.materia.models import MateriaLegislativa, TipoMateriaLegislativa
from sapl.parlamentares.models import Legislatura, Parlamentar
from sapl.protocoloadm.models import Protocolo
from sapl.utils import create_barcode, get_client_ip
import sapl
from .forms import (AnularProcoloAdmForm, DocumentoAcessorioAdministrativoForm,
DocumentoAdministrativoFilterSet,
@ -32,7 +32,6 @@ from .models import (DocumentoAcessorioAdministrativo, DocumentoAdministrativo,
StatusTramitacaoAdministrativo,
TipoDocumentoAdministrativo, TramitacaoAdministrativo)
TipoDocumentoAdministrativoCrud = CrudAux.build(
TipoDocumentoAdministrativo, '')

Loading…
Cancel
Save