Commit 66fb8bfa authored by Romain Courteaud's avatar Romain Courteaud

slapos_panel: encode json string to use UTF-8

parent 25218aea
from Products.ERP5Type.Utils import unicode2str
def getCredentialFromUrl(url_string):
username = password = url = ''
param_list = url_string.split('#')
......@@ -44,7 +46,7 @@ else:
return {}
return {
'username': username,
'password': password,
'url': url
'username': unicode2str(username),
'password': unicode2str(password),
'url': unicode2str(url)
}
from Products.ERP5Type.Document import newTempBase
from Products.ERP5Type.Utils import unicode2str
import json
return_list = []
......@@ -21,9 +23,9 @@ if relative_url == None:
for k in sorted(connection_dict):
if raw:
d = {"connection_key": k, "connection_value": connection_dict[k]}
d = {"connection_key": k, "connection_value": unicode2str(connection_dict[k])}
else:
d = newTempBase(portal, relative_url)
d.edit(connection_key=k, connection_value=connection_dict[k])
d.edit(connection_key=k, connection_value=unicode2str(connection_dict[k]))
return_list.append(d)
return return_list
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