Commit 161aa133 authored by Nicolas Delaby's avatar Nicolas Delaby

Marshaler is not able to handle unicode, convert into string ourselves

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25281 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 094b9091
......@@ -131,7 +131,13 @@ def Base_asXML(object, root=None):
for user_role in self.get_local_roles():
local_role_node = SubElement(object, 'local_role',
attrib=dict(id=user_role[0], type='tokens'))
local_role_node.text = etree.CDATA(marshaler(user_role[1]))
#convert local_roles in string because marshaler can't do it
role_list = []
for role in user_role[1]:
if isinstance(role, unicode):
role = role.encode('utf-8')
role_list.append(role)
local_role_node.text = etree.CDATA(marshaler(tuple(role_list)))
if getattr(self, 'get_local_permissions', None) is not None:
for user_permission in self.get_local_permissions():
local_permission_node = SubElement(object, 'local_permission',
......
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