diff --git a/sapl/api/views.py b/sapl/api/views.py index 5dd86cf09..71aa1b225 100644 --- a/sapl/api/views.py +++ b/sapl/api/views.py @@ -5,7 +5,8 @@ from django.utils.translation import ugettext_lazy as _ from rest_framework.filters import DjangoFilterBackend from rest_framework.generics import ListAPIView from rest_framework.mixins import ListModelMixin, RetrieveModelMixin -from rest_framework.permissions import IsAuthenticated, IsAuthenticatedOrReadOnly +from rest_framework.permissions import (IsAuthenticated, + IsAuthenticatedOrReadOnly) from rest_framework.viewsets import GenericViewSet from sapl.api.forms import AutorChoiceFilterSet diff --git a/sapl/base/forms.py b/sapl/base/forms.py index 7f1eef180..ffca1eaa6 100644 --- a/sapl/base/forms.py +++ b/sapl/base/forms.py @@ -1,3 +1,4 @@ +import django_filters from crispy_forms.bootstrap import FieldWithButtons, InlineRadios, StrictButton from crispy_forms.helper import FormHelper from crispy_forms.layout import HTML, Button, Div, Field, Fieldset, Layout, Row @@ -12,9 +13,8 @@ from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ValidationError from django.db import models, transaction from django.forms import ModelForm -from django.utils.translation import string_concat from django.utils.translation import ugettext_lazy as _ -import django_filters +from django.utils.translation import string_concat from sapl.base.models import Autor, TipoAutor from sapl.crispy_layout_mixin import (SaplFormLayout, form_actions, to_column, @@ -28,7 +28,6 @@ from sapl.utils import (RANGE_ANOS, ChoiceWithoutValidationField, from .models import AppConfig, CasaLegislativa - ACTION_CREATE_USERS_AUTOR_CHOICE = [ ('C', _('Criar novo Usuário')), ('A', _('Associar um usuário existente')), diff --git a/sapl/base/urls.py b/sapl/base/urls.py index 08f456f3b..bfaf5b7bd 100644 --- a/sapl/base/urls.py +++ b/sapl/base/urls.py @@ -1,17 +1,16 @@ from django.conf.urls import include, url from django.contrib.auth import views -from django.contrib.auth.views import (password_reset, - password_reset_done, - password_reset_confirm, - password_reset_complete) from django.contrib.auth.decorators import permission_required +from django.contrib.auth.views import (password_reset, password_reset_complete, + password_reset_confirm, + password_reset_done) from django.views.generic.base import TemplateView from sapl.base.views import AutorCrud, ConfirmarEmailView, TipoAutorCrud +from sapl.settings import EMAIL_SEND_USER from .apps import AppConfig from .forms import LoginForm, NovaSenhaForm, RecuperarSenhaForm -from sapl.settings import EMAIL_SEND_USER from .views import (AppConfigCrud, CasaLegislativaCrud, HelpView, RelatorioAtasView, RelatorioHistoricoTramitacaoView, RelatorioMateriasPorAnoAutorTipoView, diff --git a/sapl/compilacao/forms.py b/sapl/compilacao/forms.py index 0374846fc..64a2e48a3 100644 --- a/sapl/compilacao/forms.py +++ b/sapl/compilacao/forms.py @@ -25,7 +25,6 @@ from sapl.compilacao.utils import DISPOSITIVO_SELECT_RELATED from sapl.crispy_layout_mixin import SaplFormLayout, to_column, to_row from sapl.utils import YES_NO_CHOICES - error_messages = { 'required': _('Este campo é obrigatório'), 'invalid': _('URL inválida.') diff --git a/sapl/compilacao/models.py b/sapl/compilacao/models.py index c131564aa..5b022fffa 100644 --- a/sapl/compilacao/models.py +++ b/sapl/compilacao/models.py @@ -12,8 +12,8 @@ from django.template import defaultfilters from django.utils.decorators import classonlymethod from django.utils.translation import ugettext_lazy as _ -from sapl.compilacao.utils import int_to_letter, int_to_roman,\ - get_integrations_view_names +from sapl.compilacao.utils import (get_integrations_view_names, int_to_letter, + int_to_roman) from sapl.utils import YES_NO_CHOICES, get_settings_auth_user_model diff --git a/sapl/compilacao/views.py b/sapl/compilacao/views.py index bfb0903d9..2dc8f688c 100644 --- a/sapl/compilacao/views.py +++ b/sapl/compilacao/views.py @@ -1,7 +1,7 @@ -from collections import OrderedDict -from datetime import datetime, timedelta import logging import sys +from collections import OrderedDict +from datetime import datetime, timedelta from braces.views import FormMessagesMixin from django import forms @@ -10,7 +10,7 @@ from django.contrib import messages from django.contrib.auth.mixins import PermissionRequiredMixin from django.contrib.contenttypes.models import ContentType from django.core.signing import Signer -from django.core.urlresolvers import reverse_lazy, reverse +from django.core.urlresolvers import reverse, reverse_lazy from django.db import connection, transaction from django.db.models import Q from django.db.utils import IntegrityError @@ -19,8 +19,8 @@ from django.http.response import (HttpResponse, HttpResponseRedirect, from django.shortcuts import get_object_or_404, redirect from django.utils.dateparse import parse_date from django.utils.encoding import force_text -from django.utils.translation import string_concat from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import string_concat from django.views.generic.base import TemplateView from django.views.generic.detail import DetailView from django.views.generic.edit import (CreateView, DeleteView, FormView, @@ -37,20 +37,19 @@ from sapl.compilacao.forms import (DispositivoDefinidorVigenciaForm, DispositivoSearchModalForm, NotaForm, PublicacaoForm, TaForm, TextNotificacoesForm, TipoTaForm, VideForm) -from sapl.compilacao.models import (Dispositivo, Nota, +from sapl.compilacao.models import (STATUS_TA_EDITION, STATUS_TA_PRIVATE, + STATUS_TA_PUBLIC, Dispositivo, Nota, PerfilEstruturalTextoArticulado, Publicacao, TextoArticulado, TipoDispositivo, TipoNota, TipoPublicacao, TipoTextoArticulado, TipoVide, - VeiculoPublicacao, Vide, STATUS_TA_EDITION, - STATUS_TA_PRIVATE, STATUS_TA_PUBLIC) + VeiculoPublicacao, Vide) from sapl.compilacao.utils import (DISPOSITIVO_SELECT_RELATED, DISPOSITIVO_SELECT_RELATED_EDIT, get_integrations_view_names) from sapl.crud.base import Crud, CrudListView, make_pagination from sapl.settings import BASE_DIR - TipoNotaCrud = Crud.build(TipoNota, 'tipo_nota') TipoVideCrud = Crud.build(TipoVide, 'tipo_vide') TipoPublicacaoCrud = Crud.build(TipoPublicacao, 'tipo_publicacao') diff --git a/sapl/crispy_layout_mixin.py b/sapl/crispy_layout_mixin.py index 555a04f19..2c9bc7c37 100644 --- a/sapl/crispy_layout_mixin.py +++ b/sapl/crispy_layout_mixin.py @@ -1,12 +1,12 @@ from math import ceil +import rtyaml from crispy_forms.bootstrap import FormActions from crispy_forms.helper import FormHelper from crispy_forms.layout import HTML, Div, Fieldset, Layout, Submit from django import template from django.utils import formats from django.utils.translation import ugettext as _ -import rtyaml def heads_and_tails(list_of_lists): diff --git a/sapl/crud/base.py b/sapl/crud/base.py index 7c39850bf..b70e7a54a 100644 --- a/sapl/crud/base.py +++ b/sapl/crud/base.py @@ -16,8 +16,8 @@ from django.http.response import Http404 from django.shortcuts import redirect from django.utils.decorators import classonlymethod from django.utils.encoding import force_text -from django.utils.translation import string_concat from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import string_concat from django.views.generic import (CreateView, DeleteView, DetailView, ListView, UpdateView) from django.views.generic.base import ContextMixin @@ -29,7 +29,6 @@ from sapl.rules.map_rules import (RP_ADD, RP_CHANGE, RP_DELETE, RP_DETAIL, from sapl.settings import BASE_DIR from sapl.utils import normalize - logger = logging.getLogger(BASE_DIR.name) ACTION_LIST, ACTION_CREATE, ACTION_DETAIL, ACTION_UPDATE, ACTION_DELETE = \ diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 1e5f0e13b..7fece5489 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -1,24 +1,24 @@ import re +from datetime import date import pkg_resources import yaml -from datetime import date from django.apps import apps from django.apps.config import AppConfig from django.contrib.auth import get_user_model from django.core.exceptions import ObjectDoesNotExist -from django.db import connections, models, OperationalError, ProgrammingError -from django.db.models import CharField, TextField, ProtectedError, Max +from django.db import OperationalError, ProgrammingError, connections, models +from django.db.models import CharField, Max, ProtectedError, TextField from django.db.models.base import ModelBase from model_mommy import mommy from model_mommy.mommy import foreign_key_required, make from sapl.base.models import Autor, ProblemaMigracao from sapl.comissoes.models import Comissao, Composicao, Participacao +from sapl.legacy.models import Protocolo as ProtocoloLegado from sapl.materia.models import (Proposicao, StatusTramitacao, TipoDocumento, TipoMateriaLegislativa, TipoProposicao, Tramitacao) -from sapl.legacy.models import Protocolo as ProtocoloLegado from sapl.norma.models import AssuntoNorma, NormaJuridica from sapl.parlamentares.models import Parlamentar from sapl.protocoloadm.models import Protocolo, StatusTramitacaoAdministrativo diff --git a/sapl/legacy_migration_settings.py b/sapl/legacy_migration_settings.py index 4176c6df9..01b66f7ab 100644 --- a/sapl/legacy_migration_settings.py +++ b/sapl/legacy_migration_settings.py @@ -1,11 +1,10 @@ import os -from decouple import Config, RepositoryEnv, AutoConfig +from decouple import AutoConfig, Config, RepositoryEnv from dj_database_url import parse as db_url from .settings import * # flake8: noqa - config = AutoConfig() config.config = Config(RepositoryEnv(os.path.abspath('sapl/legacy/.env'))) diff --git a/sapl/materia/forms.py b/sapl/materia/forms.py index 19f3dac0c..e93f9fe6d 100644 --- a/sapl/materia/forms.py +++ b/sapl/materia/forms.py @@ -1,11 +1,9 @@ import os from datetime import date, datetime -from itertools import chain import django_filters -from crispy_forms.bootstrap import (Alert, FormActions, InlineCheckboxes, - InlineRadios) +from crispy_forms.bootstrap import Alert, FormActions, InlineRadios from crispy_forms.helper import FormHelper from crispy_forms.layout import (HTML, Button, Column, Div, Field, Fieldset, Layout, Submit) diff --git a/sapl/materia/models.py b/sapl/materia/models.py index ee453c020..e18f662d6 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -11,14 +11,13 @@ from model_utils import Choices from sapl.base.models import Autor from sapl.comissoes.models import Comissao -from sapl.compilacao.models import TextoArticulado,\ - PerfilEstruturalTextoArticulado +from sapl.compilacao.models import (PerfilEstruturalTextoArticulado, + TextoArticulado) from sapl.parlamentares.models import Parlamentar from sapl.utils import (RANGE_ANOS, YES_NO_CHOICES, SaplGenericForeignKey, SaplGenericRelation, restringe_tipos_de_arquivo_txt, texto_upload_path) - EM_TRAMITACAO = [(1, 'Sim'), (0, 'Não')] diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 619c1dde2..328de00ec 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -16,8 +16,7 @@ from django.shortcuts import get_object_or_404, redirect from django.template import Context, loader from django.utils import formats 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.views.generic.base import RedirectView from django.views.generic.edit import FormView from django_filters.views import FilterView diff --git a/sapl/norma/forms.py b/sapl/norma/forms.py index 6fc6ca521..932431d0d 100644 --- a/sapl/norma/forms.py +++ b/sapl/norma/forms.py @@ -1,5 +1,6 @@ from datetime import datetime +import django_filters from crispy_forms.helper import FormHelper from crispy_forms.layout import Fieldset, Layout from django import forms @@ -7,7 +8,6 @@ from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db import models from django.forms import ModelForm, widgets from django.utils.translation import ugettext_lazy as _ -import django_filters from sapl.crispy_layout_mixin import form_actions, to_row from sapl.materia.models import MateriaLegislativa, TipoMateriaLegislativa diff --git a/sapl/painel/views.py b/sapl/painel/views.py index 854197b16..ecaef5f4a 100644 --- a/sapl/painel/views.py +++ b/sapl/painel/views.py @@ -1,11 +1,10 @@ -from django.http.response import HttpResponseRedirect -from django.core.urlresolvers import reverse from datetime import date -from sapl.utils import get_client_ip from django.contrib.auth.decorators import user_passes_test from django.core.exceptions import ObjectDoesNotExist +from django.core.urlresolvers import reverse from django.http import HttpResponse, JsonResponse +from django.http.response import HttpResponseRedirect from django.shortcuts import render from django.utils.translation import ugettext_lazy as _ @@ -17,9 +16,12 @@ from sapl.sessao.models import (ExpedienteMateria, OrdemDia, PresencaOrdemDia, RegistroVotacao, SessaoPlenaria, SessaoPlenariaPresenca, VotoNominal, VotoParlamentar) +from sapl.utils import get_client_ip from .models import Cronometro +VOTACAO_NOMINAL = 2 + CronometroPainelCrud = Crud.build(Cronometro, '') # FIXME mudar lógica @@ -49,7 +51,7 @@ def votante_view(request, pk): if ordem_dia: materia = ordem_dia.materia - if ordem_dia.tipo_votacao == 2: + if ordem_dia.tipo_votacao == VOTACAO_NOMINAL: context.update({'materia': materia, 'ementa': materia.ementa}) presentes = PresencaOrdemDia.objects.filter(sessao_plenaria_id=pk) else: @@ -57,7 +59,7 @@ def votante_view(request, pk): {'materia': 'A matéria aberta não é votação nominal.'}) elif expediente: materia = expediente.materia - if expediente.tipo_votacao == 2: + if expediente.tipo_votacao == VOTACAO_NOMINAL: context.update({'materia': materia, 'ementa': materia.ementa}) presentes = SessaoPlenariaPresenca.objects.filter( sessao_plenaria_id=pk) diff --git a/sapl/parlamentares/apps.py b/sapl/parlamentares/apps.py index 49c8f20aa..41f6d0b38 100644 --- a/sapl/parlamentares/apps.py +++ b/sapl/parlamentares/apps.py @@ -1,6 +1,4 @@ from django import apps -from django.core.exceptions import ObjectDoesNotExist -from django.db.models.signals import post_migrate from django.utils.translation import ugettext_lazy as _ diff --git a/sapl/parlamentares/forms.py b/sapl/parlamentares/forms.py index 54022912e..3d85c3045 100644 --- a/sapl/parlamentares/forms.py +++ b/sapl/parlamentares/forms.py @@ -3,8 +3,7 @@ from datetime import date, timedelta from crispy_forms.helper import FormHelper from crispy_forms.layout import Fieldset, Layout from django import forms -from django.contrib.auth.models import Group -from django.contrib.auth.models import User +from django.contrib.auth.models import Group, User from django.core.exceptions import ValidationError from django.db import transaction from django.db.models import Q diff --git a/sapl/parlamentares/models.py b/sapl/parlamentares/models.py index 1c5e38e80..63177a734 100644 --- a/sapl/parlamentares/models.py +++ b/sapl/parlamentares/models.py @@ -5,7 +5,6 @@ from django.db import models from django.utils.translation import ugettext_lazy as _ from model_utils import Choices -from sapl.api import permissions from sapl.base.models import Autor from sapl.utils import (INDICADOR_AFASTAMENTO, UF, YES_NO_CHOICES, SaplGenericRelation, intervalos_tem_intersecao, diff --git a/sapl/parlamentares/views.py b/sapl/parlamentares/views.py index 51514caad..e1a0e22df 100644 --- a/sapl/parlamentares/views.py +++ b/sapl/parlamentares/views.py @@ -12,7 +12,6 @@ from sapl.crud.base import (RP_CHANGE, RP_DETAIL, RP_LIST, Crud, CrudAux, MasterDetailCrud) from sapl.materia.models import Proposicao, Relatoria from sapl.parlamentares.apps import AppConfig -from sapl.utils import get_client_ip from .forms import (FiliacaoForm, LegislaturaCreateForm, LegislaturaUpdateForm, ParlamentarCreateForm, ParlamentarForm, VotanteForm) @@ -106,7 +105,8 @@ class ProposicaoParlamentarCrud(CrudBaseForListAndDetailExternalAppView): class ListView(CrudBaseForListAndDetailExternalAppView.ListView): def get_context_data(self, **kwargs): - context = CrudBaseForListAndDetailExternalAppView.ListView.get_context_data(self, **kwargs) + context = CrudBaseForListAndDetailExternalAppView\ + .ListView.get_context_data(self, **kwargs) context['title'] = context['title'].replace( 'Proposições', 'Matérias') return context @@ -385,8 +385,8 @@ class MesaDiretoraView(FormView): def existe_membro_mesa(self, sessao_plenaria, cargo): return ComposicaoMesa.objects.filter( sessao_legislativa_id=sessao_plenaria.id, - #parlamentar_id = integrante.parlamentar_id, - cargo_id = cargo.id + # parlamentar_id = integrante.parlamentar_id, + cargo_id=cargo.id ).exists() def post(self, request, *args, **kwargs): diff --git a/sapl/protocoloadm/views.py b/sapl/protocoloadm/views.py index 3c9f592dd..4dea7a38b 100644 --- a/sapl/protocoloadm/views.py +++ b/sapl/protocoloadm/views.py @@ -92,7 +92,7 @@ class ProtocoloPesquisaView(PermissionRequiredMixin, FilterView): qs = self.get_queryset().order_by('ano', 'numero') qs = qs.distinct() - + if 'o' in self.request.GET and not self.request.GET['o']: qs = qs.order_by('-ano', '-numero') @@ -406,7 +406,7 @@ class PesquisarDocumentoAdministrativoView(DocumentoAdministrativoMixin, qs = self.get_queryset() qs = qs.distinct() - + if 'o' in self.request.GET and not self.request.GET['o']: qs = qs.order_by('-ano', '-numero') diff --git a/sapl/rules/apps.py b/sapl/rules/apps.py index 66fd06632..b6982b587 100644 --- a/sapl/rules/apps.py +++ b/sapl/rules/apps.py @@ -1,5 +1,6 @@ from builtins import LookupError +import django from django.apps import apps from django.conf import settings from django.contrib.auth import get_user_model @@ -7,9 +8,8 @@ from django.contrib.auth.management import _get_all_permissions from django.core import exceptions from django.db import models, router from django.db.utils import DEFAULT_DB_ALIAS -from django.utils.translation import string_concat from django.utils.translation import ugettext_lazy as _ -import django +from django.utils.translation import string_concat from sapl.rules import (SAPL_GROUP_ADMINISTRATIVO, SAPL_GROUP_COMISSOES, SAPL_GROUP_GERAL, SAPL_GROUP_MATERIA, SAPL_GROUP_NORMA, diff --git a/sapl/rules/map_rules.py b/sapl/rules/map_rules.py index 8813f0931..548eba0c4 100644 --- a/sapl/rules/map_rules.py +++ b/sapl/rules/map_rules.py @@ -7,15 +7,14 @@ from sapl.norma import models as norma from sapl.painel import models as painel from sapl.parlamentares import models as parlamentares from sapl.protocoloadm import models as protocoloadm -from sapl.rules import (SAPL_GROUP_ADMINISTRATIVO, SAPL_GROUP_ANONYMOUS, +from sapl.rules import (RP_ADD, RP_CHANGE, RP_DELETE, RP_DETAIL, RP_LIST, + SAPL_GROUP_ADMINISTRATIVO, SAPL_GROUP_ANONYMOUS, SAPL_GROUP_AUTOR, SAPL_GROUP_COMISSOES, SAPL_GROUP_GERAL, SAPL_GROUP_LOGIN_SOCIAL, SAPL_GROUP_MATERIA, SAPL_GROUP_NORMA, SAPL_GROUP_PAINEL, SAPL_GROUP_PARLAMENTAR, SAPL_GROUP_PROTOCOLO, SAPL_GROUP_SESSAO, - RP_LIST, RP_DETAIL, RP_ADD, RP_CHANGE, RP_DELETE, SAPL_GROUP_VOTANTE) - from sapl.sessao import models as sessao """ @@ -111,7 +110,8 @@ rules_group_materia = { # quando testes forem feitos para permtir que matérias possam # ser vinculadas a outras matérias via registro de compilação. # Normalmente emendas e/ou projetos substitutivos podem alterar - # uma matéria original. Fazer esse registro de compilação ofereceria + # uma matéria original. + # Fazer esse registro de compilação ofereceria # um autografo eletrônico pronto para ser convertido em Norma. ]) ] diff --git a/sapl/sessao/models.py b/sapl/sessao/models.py index 530dd77d0..369b5a0e2 100644 --- a/sapl/sessao/models.py +++ b/sapl/sessao/models.py @@ -85,6 +85,7 @@ def ata_upload_path(instance, filename): return texto_upload_path(instance, filename, subpath='ata') # return get_sessao_media_path(instance, 'ata', filename) + def anexo_upload_path(instance, filename): return texto_upload_path(instance, filename, subpath='anexo') # return get_sessao_media_path(instance, 'anexo', filename) @@ -171,7 +172,8 @@ class SessaoPlenaria(models.Model): def save(self, force_insert=False, force_update=False, using=None, update_fields=None): - if not self.pk and (self.upload_pauta or self.upload_ata or self.upload_anexo): + if not self.pk and (self.upload_pauta or + self.upload_ata or self.upload_anexo): upload_pauta = self.upload_pauta upload_ata = self.upload_ata upload_anexo = self.upload_anexo diff --git a/sapl/settings.py b/sapl/settings.py index 9a072211d..918b4d2b2 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -14,7 +14,6 @@ See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ """ import logging -import sys from decouple import config from dj_database_url import parse as db_url diff --git a/sapl/test_urls.py b/sapl/test_urls.py index 214b7e7bf..bcddfcc9e 100644 --- a/sapl/test_urls.py +++ b/sapl/test_urls.py @@ -1,12 +1,12 @@ +import pytest from django.apps import apps from django.contrib.auth import get_user_model from django.contrib.auth.management import _get_all_permissions from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.db import transaction -from django.utils.translation import string_concat from django.utils.translation import ugettext_lazy as _ -import pytest +from django.utils.translation import string_concat from sapl.crud.base import PermissionRequiredForAppCrudMixin from sapl.rules.apps import AppConfig, update_groups @@ -14,7 +14,6 @@ from scripts.lista_urls import lista_urls from .settings import SAPL_APPS - pytestmark = pytest.mark.django_db sapl_appconfs = [apps.get_app_config(n[5:]) for n in SAPL_APPS] diff --git a/sapl/urls.py b/sapl/urls.py index 1869e760c..58deafa3a 100644 --- a/sapl/urls.py +++ b/sapl/urls.py @@ -17,7 +17,7 @@ from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin -from django.views.generic.base import TemplateView, RedirectView +from django.views.generic.base import RedirectView, TemplateView from django.views.static import serve as view_static_server import sapl.api.urls @@ -33,7 +33,6 @@ import sapl.protocoloadm.urls import sapl.relatorios.urls import sapl.sessao.urls - urlpatterns = [ url(r'^$', TemplateView.as_view(template_name='index.html')), url(r'^message$', TemplateView.as_view(template_name='base.html')), diff --git a/sapl/utils.py b/sapl/utils.py index 89f3829c8..bda144e5d 100644 --- a/sapl/utils.py +++ b/sapl/utils.py @@ -1,10 +1,12 @@ -from datetime import date -from functools import wraps -from unicodedata import normalize as unicodedata_normalize import hashlib import logging import re +from datetime import date +from functools import wraps +from unicodedata import normalize as unicodedata_normalize +import django_filters +import magic from crispy_forms.helper import FormHelper from crispy_forms.layout import HTML, Button from django import forms @@ -16,13 +18,10 @@ from django.contrib.contenttypes.fields import (GenericForeignKey, GenericRel, from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from floppyforms import ClearableFileInput -import django_filters -import magic from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row from sapl.settings import BASE_DIR - sapl_logger = logging.getLogger(BASE_DIR.name)