From b0e5162dcd439bb718bb58877b65559a7f42ad31 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Fri, 20 Apr 2018 17:42:20 -0300 Subject: [PATCH] =?UTF-8?q?Reaponta=20MEDIA=5FROOT=20para=20repo=20em=20mi?= =?UTF-8?q?gra=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migracao_dados.py | 8 +++----- sapl/legacy_migration_settings.py | 8 ++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/sapl/legacy/migracao_dados.py b/sapl/legacy/migracao_dados.py index 922cc99a6..301b11458 100644 --- a/sapl/legacy/migracao_dados.py +++ b/sapl/legacy/migracao_dados.py @@ -31,8 +31,9 @@ from sapl.comissoes.models import Comissao, Composicao, Participacao from sapl.legacy import scripts from sapl.legacy.models import NormaJuridica as OldNormaJuridica from sapl.legacy.models import TipoNumeracaoProtocolo -from sapl.legacy.scripts.exporta_zope.variaveis_comuns import \ - DIR_DADOS_MIGRACAO +from sapl.legacy_migration_settings import (DATABASES, DIR_DADOS_MIGRACAO, + DIR_REPO, NOME_BANCO_LEGADO, + PROJECT_DIR) from sapl.materia.models import (AcompanhamentoMateria, MateriaLegislativa, Proposicao, StatusTramitacao, TipoDocumento, TipoMateriaLegislativa, TipoProposicao, @@ -45,7 +46,6 @@ from sapl.protocoloadm.models import (DocumentoAdministrativo, Protocolo, StatusTramitacaoAdministrativo) from sapl.sessao.models import (ExpedienteMateria, OrdemDia, RegistroVotacao, TipoResultadoVotacao) -from sapl.settings import DATABASES, PROJECT_DIR from sapl.utils import normalize from .timezonesbrasil import get_timezone @@ -733,8 +733,6 @@ def reinicia_sequence(model, id): sequence_name, id)) -NOME_BANCO_LEGADO = DATABASES['legacy']['NAME'] -DIR_REPO = Path(DIR_DADOS_MIGRACAO, 'repos', NOME_BANCO_LEGADO) REPO = git.Repo.init(DIR_REPO) diff --git a/sapl/legacy_migration_settings.py b/sapl/legacy_migration_settings.py index 0d8844147..96f6a83ad 100644 --- a/sapl/legacy_migration_settings.py +++ b/sapl/legacy_migration_settings.py @@ -3,6 +3,9 @@ import os from decouple import Config, RepositoryEnv from dj_database_url import parse as db_url +from sapl.legacy.scripts.exporta_zope.variaveis_comuns import \ + DIR_DADOS_MIGRACAO + from .settings import * # flake8: noqa config = Config(RepositoryEnv(BASE_DIR.child('legacy', '.env'))) @@ -35,3 +38,8 @@ DEBUG = True HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.BaseSignalProcessor' SHELL_PLUS_DONT_LOAD = ['legacy'] + +NOME_BANCO_LEGADO = DATABASES['legacy']['NAME'] +DIR_REPO = Path(DIR_DADOS_MIGRACAO, 'repos', NOME_BANCO_LEGADO) + +MEDIA_ROOT = DIR_REPO