[FIX] orm: allow unicode in inherit views with attribute

When extending a view with position='attributes', prevent crash if view contains unicode char
Fixes #706
This commit is contained in:
kevin wang 2014-06-23 12:48:27 +02:00 committed by Martin Trigaux
parent 7e85786b83
commit 59c27970b5
1 changed files with 1 additions and 1 deletions

View File

@ -2162,7 +2162,7 @@ class BaseModel(object):
node.getparent().remove(node)
elif pos == 'attributes':
for child in spec.getiterator('attribute'):
attribute = (child.get('name'), child.text and child.text.encode('utf8') or None)
attribute = (child.get('name'), child.text or None)
if attribute[1]:
node.set(attribute[0], attribute[1])
else: