diff --git a/sapl/base/models.py b/sapl/base/models.py index e481e4d1d..640bb7d52 100644 --- a/sapl/base/models.py +++ b/sapl/base/models.py @@ -1,8 +1,8 @@ +import reversion from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.translation import ugettext_lazy as _ -import reversion from sapl.utils import UF, YES_NO_CHOICES, get_settings_auth_user_model diff --git a/sapl/comissoes/models.py b/sapl/comissoes/models.py index 3f0a37144..4483dd07a 100644 --- a/sapl/comissoes/models.py +++ b/sapl/comissoes/models.py @@ -1,8 +1,8 @@ +import reversion from django.db import models from django.utils.translation import ugettext_lazy as _ from model_utils import Choices -import reversion from sapl.base.models import Autor from sapl.parlamentares.models import Parlamentar diff --git a/sapl/compilacao/models.py b/sapl/compilacao/models.py index a633303ee..2b0e63473 100644 --- a/sapl/compilacao/models.py +++ b/sapl/compilacao/models.py @@ -1,5 +1,6 @@ from datetime import datetime +import reversion from django.contrib import messages from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType @@ -11,7 +12,6 @@ from django.http.response import Http404 from django.template import defaultfilters from django.utils.decorators import classonlymethod from django.utils.translation import ugettext_lazy as _ -import reversion from sapl.compilacao.utils import (get_integrations_view_names, int_to_letter, int_to_roman) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 626aed4ee..f4b6f00a6 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -1,20 +1,20 @@ import re from datetime import date +from subprocess import PIPE, call -from subprocess import call, PIPE import pkg_resources +import reversion import yaml from django.apps import apps from django.apps.config import AppConfig from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist -from django.db import connections, models, OperationalError, ProgrammingError -from django.db.models import CharField, TextField, ProtectedError, Max, signals +from django.db import OperationalError, ProgrammingError, connections, models +from django.db.models import CharField, Max, ProtectedError, TextField, signals from django.db.models.base import ModelBase from model_mommy import mommy from model_mommy.mommy import foreign_key_required, make -import reversion from reversion.models import Revision, Version from sapl.base.models import Autor, ProblemaMigracao @@ -23,7 +23,6 @@ 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, TipoVinculoNormaJuridica) from sapl.parlamentares.models import Parlamentar diff --git a/sapl/lexml/models.py b/sapl/lexml/models.py index 8c30d9ee1..f6315d399 100644 --- a/sapl/lexml/models.py +++ b/sapl/lexml/models.py @@ -1,6 +1,6 @@ +import reversion from django.db import models from django.utils.translation import ugettext_lazy as _ -import reversion @reversion.register() diff --git a/sapl/materia/models.py b/sapl/materia/models.py index c0d5f3383..02b63840a 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -1,5 +1,6 @@ from datetime import datetime +import reversion from django.contrib.auth.models import Group from django.contrib.contenttypes.fields import GenericRelation from django.contrib.contenttypes.models import ContentType @@ -8,7 +9,6 @@ from django.db.models.deletion import PROTECT from django.utils import formats from django.utils.translation import ugettext_lazy as _ from model_utils import Choices -import reversion from sapl.base.models import Autor from sapl.comissoes.models import Comissao diff --git a/sapl/norma/models.py b/sapl/norma/models.py index 86745c8b1..8a412be1c 100644 --- a/sapl/norma/models.py +++ b/sapl/norma/models.py @@ -1,9 +1,9 @@ +import reversion from django.contrib.contenttypes.fields import GenericRelation from django.db import models from django.template import defaultfilters from django.utils.translation import ugettext_lazy as _ from model_utils import Choices -import reversion from sapl.compilacao.models import TextoArticulado from sapl.materia.models import MateriaLegislativa diff --git a/sapl/painel/models.py b/sapl/painel/models.py index 0f3427f3a..097981520 100644 --- a/sapl/painel/models.py +++ b/sapl/painel/models.py @@ -1,6 +1,6 @@ +import reversion from django.db import models from django.utils.translation import ugettext_lazy as _ -import reversion @reversion.register() diff --git a/sapl/parlamentares/models.py b/sapl/parlamentares/models.py index 28a2e5677..aece985c8 100644 --- a/sapl/parlamentares/models.py +++ b/sapl/parlamentares/models.py @@ -1,10 +1,10 @@ from datetime import datetime +import reversion from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext_lazy as _ from model_utils import Choices -import reversion from sapl.base.models import Autor from sapl.utils import (INDICADOR_AFASTAMENTO, UF, YES_NO_CHOICES, diff --git a/sapl/protocoloadm/models.py b/sapl/protocoloadm/models.py index 25bee0665..78cfc7fd3 100644 --- a/sapl/protocoloadm/models.py +++ b/sapl/protocoloadm/models.py @@ -1,7 +1,7 @@ +import reversion from django.db import models from django.utils.translation import ugettext_lazy as _ from model_utils import Choices -import reversion from sapl.base.models import Autor from sapl.materia.models import TipoMateriaLegislativa, UnidadeTramitacao diff --git a/sapl/rules/apps.py b/sapl/rules/apps.py index e9bf2c50e..ab8c6322c 100644 --- a/sapl/rules/apps.py +++ b/sapl/rules/apps.py @@ -1,6 +1,7 @@ from builtins import LookupError import django +import reversion from django.apps import apps from django.conf import settings from django.contrib.auth import get_user_model @@ -10,8 +11,6 @@ from django.db import models, router from django.db.utils import DEFAULT_DB_ALIAS from django.utils.translation import ugettext_lazy as _ from django.utils.translation import string_concat -import django -import reversion from sapl.rules import (SAPL_GROUP_ADMINISTRATIVO, SAPL_GROUP_COMISSOES, SAPL_GROUP_GERAL, SAPL_GROUP_MATERIA, SAPL_GROUP_NORMA, diff --git a/sapl/sessao/models.py b/sapl/sessao/models.py index 572a1cad2..ffbb4d753 100644 --- a/sapl/sessao/models.py +++ b/sapl/sessao/models.py @@ -1,8 +1,8 @@ +import reversion from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext_lazy as _ from model_utils import Choices -import reversion from sapl.base.models import Autor from sapl.materia.models import MateriaLegislativa diff --git a/sapl/sessao/urls.py b/sapl/sessao/urls.py index d90fb64bb..3e43ff1bc 100644 --- a/sapl/sessao/urls.py +++ b/sapl/sessao/urls.py @@ -19,12 +19,12 @@ from sapl.sessao.views import (AdicionarVariasMateriasExpediente, VotacaoNominalExpedienteView, VotacaoNominalView, VotacaoView, abrir_votacao_expediente_view, - abrir_votacao_ordem_view, recuperar_materia, + abrir_votacao_ordem_view, + mudar_ordem_materia_sessao, recuperar_materia, recuperar_numero_sessao, reordernar_materias_expediente, reordernar_materias_ordem, - sessao_legislativa_legislatura_ajax, - mudar_ordem_materia_sessao) + sessao_legislativa_legislatura_ajax) from .apps import AppConfig diff --git a/sapl/utils.py b/sapl/utils.py index 9afe021a8..09902fae9 100644 --- a/sapl/utils.py +++ b/sapl/utils.py @@ -20,8 +20,6 @@ from django.utils.text import slugify from django.utils.translation import ugettext_lazy as _ from floppyforms import ClearableFileInput from reversion.admin import VersionAdmin -import django_filters -import magic from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row from sapl.settings import BASE_DIR