Commit 0c810127 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Explicitly check if attribute_value is a string instead of not a unicode...

Explicitly check if attribute_value is a string instead of not a unicode string. Also, if attribute_value is None, set it to an empty string.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1431 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f4a92b76
......@@ -1353,8 +1353,10 @@ onChange="submitAction(this.form,'%s/portal_selections/setReportRoot')">
td_align = "left"
# It is safer to convert attribute_value to an unicode string, because
# it might be utf-8.
if type(attribute_value) != type(u''):
if type(attribute_value) == type(''):
attribute_value = unicode(attribute_value, 'utf-8')
elif attribute_value is None:
attribute_value = ''
if sql in editable_column_ids and form.has_field('%s_%s' % (field.id, alias) ):
key = my_field.id + '_%s' % o.uid
if field_errors.has_key(key):
......
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