Commit 363034bc authored by Aurel's avatar Aurel

handle backslash caracters at import in portal types roles items


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5666 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c0d10c5e
...@@ -1821,7 +1821,7 @@ class PortalTypeRolesTemplateItem(BaseTemplateItem): ...@@ -1821,7 +1821,7 @@ class PortalTypeRolesTemplateItem(BaseTemplateItem):
for property in property_list: for property in property_list:
property_id = property.getAttribute('id').encode() property_id = property.getAttribute('id').encode()
if property.hasChildNodes(): if property.hasChildNodes():
property_value = property.childNodes[0].data.encode() property_value = property.childNodes[0].data.encode('utf_8', 'backslashreplace')
if property_id == 'priority': if property_id == 'priority':
property_value = float(property_value) property_value = float(property_value)
type_role_property_dict[property_id] = property_value type_role_property_dict[property_id] = property_value
...@@ -1832,7 +1832,7 @@ class PortalTypeRolesTemplateItem(BaseTemplateItem): ...@@ -1832,7 +1832,7 @@ class PortalTypeRolesTemplateItem(BaseTemplateItem):
if not type_role_property_dict.has_key(property_id): if not type_role_property_dict.has_key(property_id):
type_role_property_dict[property_id] = [] type_role_property_dict[property_id] = []
if property.hasChildNodes(): if property.hasChildNodes():
property_value = property.childNodes[0].data.encode() property_value = property.childNodes[0].data.encode('utf_8', 'backslashreplace')
type_role_property_dict[property_id].append(property_value) type_role_property_dict[property_id].append(property_value)
type_roles_list.append(type_role_property_dict) type_roles_list.append(type_role_property_dict)
self._objects['portal_type_roles/'+file_name[:-4]] = type_roles_list self._objects['portal_type_roles/'+file_name[:-4]] = type_roles_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