Browse Source

Ajusta QA check

pull/776/head
Edward Ribeiro 8 years ago
parent
commit
698e53a8c5
  1. 1
      sapl/base/templatetags/common_tags.py
  2. 6
      sapl/materia/forms.py
  3. 2
      sapl/materia/tests/test_materia.py
  4. 4
      sapl/materia/views.py
  5. 1
      sapl/painel/views.py
  6. 3
      sapl/protocoloadm/forms.py
  7. 2
      sapl/protocoloadm/urls.py
  8. 5
      sapl/protocoloadm/views.py
  9. 3
      sapl/rules/tests/test_rules.py
  10. 2
      sapl/sessao/views.py
  11. 14
      sapl/utils.py

1
sapl/base/templatetags/common_tags.py

@ -3,6 +3,7 @@ from django import template
from sapl.base.models import AppConfig from sapl.base.models import AppConfig
from sapl.parlamentares.models import Filiacao from sapl.parlamentares.models import Filiacao
register = template.Library() register = template.Library()

6
sapl/materia/forms.py

@ -1,7 +1,8 @@
from datetime import date, datetime
import os import os
from datetime import date, datetime
import django_filters
from crispy_forms.bootstrap import (Alert, FormActions, InlineCheckboxes, from crispy_forms.bootstrap import (Alert, FormActions, InlineCheckboxes,
InlineRadios) InlineRadios)
from crispy_forms.helper import FormHelper from crispy_forms.helper import FormHelper
@ -17,8 +18,8 @@ from django.db.models import Max
from django.forms import ModelForm, widgets from django.forms import ModelForm, widgets
from django.forms.forms import Form from django.forms.forms import Form
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import django_filters
import sapl
from sapl.base.models import Autor from sapl.base.models import Autor
from sapl.comissoes.models import Comissao from sapl.comissoes.models import Comissao
from sapl.crispy_layout_mixin import (SaplFormLayout, form_actions, to_column, from sapl.crispy_layout_mixin import (SaplFormLayout, form_actions, to_column,
@ -32,7 +33,6 @@ from sapl.settings import MAX_DOC_UPLOAD_SIZE
from sapl.utils import (RANGE_ANOS, YES_NO_CHOICES, from sapl.utils import (RANGE_ANOS, YES_NO_CHOICES,
ChoiceWithoutValidationField, RangeWidgetOverride, ChoiceWithoutValidationField, RangeWidgetOverride,
autor_label, autor_modal, models_with_gr_for_model) autor_label, autor_modal, models_with_gr_for_model)
import sapl
from .models import (AcompanhamentoMateria, Anexada, Autoria, DespachoInicial, from .models import (AcompanhamentoMateria, Anexada, Autoria, DespachoInicial,
DocumentoAcessorio, MateriaLegislativa, Numeracao, DocumentoAcessorio, MateriaLegislativa, Numeracao,

2
sapl/materia/tests/test_materia.py

@ -1,9 +1,9 @@
import pytest
from django.contrib.auth import get_user_model from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.core.files.uploadedfile import SimpleUploadedFile from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from model_mommy import mommy from model_mommy import mommy
import pytest
from sapl.base.models import Autor, TipoAutor from sapl.base.models import Autor, TipoAutor
from sapl.comissoes.models import Comissao, TipoComissao from sapl.comissoes.models import Comissao, TipoComissao

4
sapl/materia/views.py

@ -21,6 +21,7 @@ from django.views.generic.base import RedirectView
from django.views.generic.edit import FormView from django.views.generic.edit import FormView
from django_filters.views import FilterView from django_filters.views import FilterView
import sapl
from sapl.base.models import Autor, CasaLegislativa from sapl.base.models import Autor, CasaLegislativa
from sapl.compilacao.views import IntegracaoTaView from sapl.compilacao.views import IntegracaoTaView
from sapl.crispy_layout_mixin import SaplFormLayout, form_actions from sapl.crispy_layout_mixin import SaplFormLayout, form_actions
@ -28,7 +29,6 @@ from sapl.crud.base import (ACTION_CREATE, ACTION_DELETE, ACTION_DETAIL,
ACTION_LIST, ACTION_UPDATE, RP_DETAIL, RP_LIST, ACTION_LIST, ACTION_UPDATE, RP_DETAIL, RP_LIST,
Crud, CrudAux, MasterDetailCrud, Crud, CrudAux, MasterDetailCrud,
PermissionRequiredForAppCrudMixin, make_pagination) PermissionRequiredForAppCrudMixin, make_pagination)
from sapl.materia import apps
from sapl.materia.forms import (AnexadaForm, ConfirmarProposicaoForm, from sapl.materia.forms import (AnexadaForm, ConfirmarProposicaoForm,
LegislacaoCitadaForm, ProposicaoForm, LegislacaoCitadaForm, ProposicaoForm,
TipoProposicaoForm) TipoProposicaoForm)
@ -36,7 +36,6 @@ from sapl.norma.models import LegislacaoCitada
from sapl.utils import (TURNO_TRAMITACAO_CHOICES, YES_NO_CHOICES, autor_label, from sapl.utils import (TURNO_TRAMITACAO_CHOICES, YES_NO_CHOICES, autor_label,
autor_modal, gerar_hash_arquivo, get_base_url, autor_modal, gerar_hash_arquivo, get_base_url,
montar_row_autor) montar_row_autor)
import sapl
from .forms import (AcessorioEmLoteFilterSet, AcompanhamentoMateriaForm, from .forms import (AcessorioEmLoteFilterSet, AcompanhamentoMateriaForm,
DocumentoAcessorioForm, MateriaLegislativaFilterSet, DocumentoAcessorioForm, MateriaLegislativaFilterSet,
@ -51,7 +50,6 @@ from .models import (AcompanhamentoMateria, Anexada, Autoria, DespachoInicial,
TipoMateriaLegislativa, TipoProposicao, Tramitacao, TipoMateriaLegislativa, TipoProposicao, Tramitacao,
UnidadeTramitacao) UnidadeTramitacao)
OrigemCrud = Crud.build(Origem, '') OrigemCrud = Crud.build(Origem, '')
TipoMateriaCrud = CrudAux.build( TipoMateriaCrud = CrudAux.build(

1
sapl/painel/views.py

@ -16,7 +16,6 @@ from sapl.sessao.models import (ExpedienteMateria, OrdemDia, PresencaOrdemDia,
from .models import Cronometro from .models import Cronometro
CronometroPainelCrud = Crud.build(Cronometro, '') CronometroPainelCrud = Crud.build(Cronometro, '')
# FIXME mudar lógica # FIXME mudar lógica

3
sapl/protocoloadm/forms.py

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

2
sapl/protocoloadm/urls.py

@ -9,7 +9,7 @@ from sapl.protocoloadm.views import (AnularProtocoloAdmView,
DocumentoAcessorioAdministrativoView, DocumentoAcessorioAdministrativoView,
DocumentoAdministrativoCrud, DocumentoAdministrativoCrud,
PesquisarDocumentoAdministrativoView, PesquisarDocumentoAdministrativoView,
ProtocoloDocumentoView, ProtocoloListView, ProtocoloDocumentoView,
ProtocoloMateriaView, ProtocoloMateriaView,
ProtocoloMostrarView, ProtocoloMostrarView,
ProtocoloPesquisaView, ProtocoloPesquisaView,

5
sapl/protocoloadm/views.py

@ -12,10 +12,10 @@ from django.views.generic import CreateView, DetailView, FormView, ListView
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from django_filters.views import FilterView from django_filters.views import FilterView
import sapl
from sapl.crud.base import Crud, CrudAux, MasterDetailCrud, make_pagination from sapl.crud.base import Crud, CrudAux, MasterDetailCrud, make_pagination
from sapl.materia.models import TipoMateriaLegislativa from sapl.materia.models import TipoMateriaLegislativa
from sapl.utils import (create_barcode, get_client_ip) from sapl.utils import create_barcode, get_client_ip
import sapl
from .forms import (AnularProcoloAdmForm, DocumentoAcessorioAdministrativoForm, from .forms import (AnularProcoloAdmForm, DocumentoAcessorioAdministrativoForm,
DocumentoAdministrativoFilterSet, DocumentoAdministrativoFilterSet,
@ -26,7 +26,6 @@ from .models import (DocumentoAcessorioAdministrativo, DocumentoAdministrativo,
Protocolo, StatusTramitacaoAdministrativo, Protocolo, StatusTramitacaoAdministrativo,
TipoDocumentoAdministrativo, TramitacaoAdministrativo) TipoDocumentoAdministrativo, TramitacaoAdministrativo)
TipoDocumentoAdministrativoCrud = CrudAux.build( TipoDocumentoAdministrativoCrud = CrudAux.build(
TipoDocumentoAdministrativo, '') TipoDocumentoAdministrativo, '')

3
sapl/rules/tests/test_rules.py

@ -1,10 +1,10 @@
import pytest
from django.apps import apps from django.apps import apps
from django.conf import settings from django.conf import settings
from django.contrib.auth.models import Permission from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.utils import six from django.utils import six
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import pytest
from sapl.base.models import CasaLegislativa, ProblemaMigracao from sapl.base.models import CasaLegislativa, ProblemaMigracao
from sapl.compilacao.models import TipoDispositivo,\ from sapl.compilacao.models import TipoDispositivo,\
@ -17,7 +17,6 @@ from scripts.lista_permissions_in_decorators import \
lista_permissions_in_decorators lista_permissions_in_decorators
from scripts.lista_urls import lista_urls from scripts.lista_urls import lista_urls
sapl_appconfs = [apps.get_app_config(n[5:]) for n in settings.SAPL_APPS] sapl_appconfs = [apps.get_app_config(n[5:]) for n in settings.SAPL_APPS]
sapl_models = [] sapl_models = []

2
sapl/sessao/views.py

@ -29,7 +29,6 @@ from sapl.materia.views import MateriaLegislativaPesquisaView
from sapl.norma.models import NormaJuridica from sapl.norma.models import NormaJuridica
from sapl.parlamentares.models import (Legislatura, Parlamentar, from sapl.parlamentares.models import (Legislatura, Parlamentar,
SessaoLegislativa) SessaoLegislativa)
from sapl.sessao.apps import AppConfig from sapl.sessao.apps import AppConfig
from sapl.sessao.forms import ExpedienteMateriaForm, OrdemDiaForm from sapl.sessao.forms import ExpedienteMateriaForm, OrdemDiaForm
@ -45,7 +44,6 @@ from .models import (Bancada, Bloco, CargoBancada, CargoMesa,
SessaoPlenariaPresenca, TipoExpediente, SessaoPlenariaPresenca, TipoExpediente,
TipoResultadoVotacao, TipoSessaoPlenaria, VotoParlamentar) TipoResultadoVotacao, TipoSessaoPlenaria, VotoParlamentar)
TipoSessaoCrud = CrudAux.build(TipoSessaoPlenaria, 'tipo_sessao_plenaria') TipoSessaoCrud = CrudAux.build(TipoSessaoPlenaria, 'tipo_sessao_plenaria')
TipoExpedienteCrud = CrudAux.build(TipoExpediente, 'tipo_expediente') TipoExpedienteCrud = CrudAux.build(TipoExpediente, 'tipo_expediente')
CargoBancadaCrud = CrudAux.build(CargoBancada, '') CargoBancadaCrud = CrudAux.build(CargoBancada, '')

14
sapl/utils.py

@ -1,30 +1,26 @@
from datetime import date
from functools import wraps
from unicodedata import normalize as unicodedata_normalize
import hashlib import hashlib
import logging import logging
import re import re
from datetime import date
from functools import wraps
from unicodedata import normalize as unicodedata_normalize
import magic
from crispy_forms.helper import FormHelper from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, Button from crispy_forms.layout import HTML, Button
from django import forms from django import forms
from django.apps import apps from django.apps import apps
from django.conf import settings from django.conf import settings
from django.contrib import admin from django.contrib import admin
from django.contrib.auth.decorators import user_passes_test
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.fields import (GenericForeignKey, GenericRel, from django.contrib.contenttypes.fields import (GenericForeignKey, GenericRel,
GenericRelation) GenericRelation)
from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ValidationError
from django.core.exceptions import PermissionDenied, ValidationError
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from floppyforms import ClearableFileInput from floppyforms import ClearableFileInput
import magic
from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row
from sapl.settings import BASE_DIR from sapl.settings import BASE_DIR
sapl_logger = logging.getLogger(BASE_DIR.name) sapl_logger = logging.getLogger(BASE_DIR.name)

Loading…
Cancel
Save