Browse Source

Autodecodifica nomes de usuários ao exportar zope

pull/2023/head
Marcio Mazza 7 years ago
parent
commit
da44d3c7c9
  1. 8
      sapl/legacy/scripts/exporta_zope/exporta_zope.py

8
sapl/legacy/scripts/exporta_zope/exporta_zope.py

@ -17,12 +17,12 @@ from functools import partial
import git import git
import magic import magic
import yaml import yaml
import ZODB.DB
import ZODB.FileStorage
from unipath import Path from unipath import Path
from ZODB.broken import Broken
import ZODB.DB
import ZODB.FileStorage
from variaveis_comuns import DIR_DADOS_MIGRACAO, TAG_ZOPE from variaveis_comuns import DIR_DADOS_MIGRACAO, TAG_ZOPE
from ZODB.broken import Broken
EXTENSOES = { EXTENSOES = {
'application/msword': '.doc', 'application/msword': '.doc',
@ -308,6 +308,8 @@ def dump_propriedades(docs, path, salvar):
def dump_usuarios(sapl, path, salvar): def dump_usuarios(sapl, path, salvar):
users = br(br(sapl['acl_users'])['data']) users = br(br(sapl['acl_users'])['data'])
users = {autodecode(k): br(v) for k, v in users['data'].items()} users = {autodecode(k): br(v) for k, v in users['data'].items()}
for dados in users.values():
dados['name'] = autodecode(dados['name'])
save_as_yaml(path, 'usuarios.yaml', users, salvar) save_as_yaml(path, 'usuarios.yaml', users, salvar)

Loading…
Cancel
Save