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