Commit a68b268b authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Jérome Perrin

fixup! TemplateTool: use json to encode repository business template uid

parent 67809547
......@@ -66,7 +66,7 @@ from Products.ERP5Type.Message import translateString
from zLOG import LOG, INFO, WARNING
import subprocess
import time
from Products.ERP5Type.Utils import bytes2str
from Products.ERP5Type.Utils import bytes2str, str2bytes, unicode2str
import json
WIN = os.name == 'nt'
......@@ -712,7 +712,7 @@ class TemplateTool (BaseTool):
Return a repository and an id.
"""
repository, id = json.loads(b64decode(uid))
return repository.encode('utf-8'), id.encode('utf-8')
return unicode2str(repository), unicode2str(id)
security.declarePublic( 'encodeRepositoryBusinessTemplateUid' )
def encodeRepositoryBusinessTemplateUid(self, repository, id):
......@@ -720,7 +720,7 @@ class TemplateTool (BaseTool):
encode the repository and the id of a business template.
Return an uid.
"""
return b64encode(json.dumps((repository, id)))
return b64encode(str2bytes(json.dumps((repository, id))))
security.declarePublic('compareVersionStrings')
def compareVersionStrings(self, version, comparing_string):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment