Abdul muhaimin
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
5 additions and
5 deletions
-
sapl/legacy/migracao_usuarios.py
-
sapl/legacy/scripts/ressuscita_dependencias.py
-
sapl/legacy_migration_settings.py
-
sapl/test_crispy_layout_mixin.py
|
|
@ -71,7 +71,7 @@ def migrar_usuarios(dir_repo): |
|
|
|
|
|
|
|
ARQUIVO_USUARIOS = Path(dir_repo).child('usuarios.yaml') |
|
|
|
with open(ARQUIVO_USUARIOS, 'r') as f: |
|
|
|
usuarios = yaml.load(f, yaml.Loader) |
|
|
|
usuarios = yaml.load(f, yaml.SafeLoader) |
|
|
|
# conferimos de que só há um nome de usuário |
|
|
|
assert all(nome == dados['name'] for nome, dados in usuarios.items()) |
|
|
|
usuarios = [ |
|
|
|
|
|
@ -198,7 +198,7 @@ Para facilitar sua conferência, seguem os links para as proposições envolvida |
|
|
|
def get_dependencias_a_ressuscitar(slug): |
|
|
|
ocorrencias = yaml.load( |
|
|
|
Path(DIR_REPO.child('ocorrencias.yaml').read_file()), |
|
|
|
yaml.Loader |
|
|
|
yaml.SafeLoader |
|
|
|
) |
|
|
|
fks_faltando = ocorrencias.get('fk') |
|
|
|
if not fks_faltando: |
|
|
@ -414,7 +414,7 @@ def get_ressuscitar(slug): |
|
|
|
def get_slug(): |
|
|
|
arq = DIR_DADOS_MIGRACAO.child('siglas_para_slugs.yaml') |
|
|
|
with open(arq, 'r') as arq: |
|
|
|
siglas_para_slugs = yaml.load(arq, yaml.Loader) |
|
|
|
siglas_para_slugs = yaml.load(arq, yaml.SafeLoader) |
|
|
|
sigla = NOME_BANCO_LEGADO[-3:] |
|
|
|
return siglas_para_slugs[sigla] |
|
|
|
|
|
|
|
|
|
@ -54,7 +54,7 @@ match = re.match('sapl_cm_(.*)', NOME_BANCO_LEGADO) |
|
|
|
SIGLA_CASA = match.group(1) |
|
|
|
_PATH_TABELA_TIMEZONES = DIR_DADOS_MIGRACAO.child('tabela_timezones.yaml') |
|
|
|
with open(_PATH_TABELA_TIMEZONES, 'r') as arq: |
|
|
|
tabela_timezones = yaml.load(arq, yaml.Loader) |
|
|
|
tabela_timezones = yaml.load(arq, yaml.SafeLoader) |
|
|
|
municipio, uf, nome_timezone = tabela_timezones[SIGLA_CASA] |
|
|
|
if nome_timezone: |
|
|
|
PYTZ_TIMEZONE = pytz.timezone(nome_timezone) |
|
|
|
|
|
@ -18,7 +18,7 @@ ModelName: |
|
|
|
- highlander ''' |
|
|
|
|
|
|
|
with mock.patch('sapl.crispy_layout_mixin.read_yaml_from_file') as ryff: |
|
|
|
ryff.return_value = yaml.load(stub_content, yaml.Loader) |
|
|
|
ryff.return_value = yaml.load(stub_content, yaml.SafeLoader) |
|
|
|
assert read_layout_from_yaml('....', 'ModelName') == [ |
|
|
|
['Cool Legend', |
|
|
|
[('name', 9), ('place', 2), ('tiny', 1)], |
|
|
|