Commit 143becb4 authored by Tristan Cavelier's avatar Tristan Cavelier Committed by Yusei Tahara

erp5_hal_json_style: Fix isinstance parameter

TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types
parent 315798b2
...@@ -464,7 +464,7 @@ def getFieldDefault(form, field, key, value=None): ...@@ -464,7 +464,7 @@ def getFieldDefault(form, field, key, value=None):
if value is None: if value is None:
value = (REQUEST.form.get(field.id, REQUEST.form.get(key, None)) or value = (REQUEST.form.get(field.id, REQUEST.form.get(key, None)) or
field.get_value('default', request=REQUEST, REQUEST=REQUEST)) field.get_value('default', request=REQUEST, REQUEST=REQUEST))
if field.has_value("unicode") and field.get_value("unicode") and isinstance(value, 'unicode'): if field.has_value("unicode") and field.get_value("unicode") and isinstance(value, unicode):
value = unicode(value, form.get_form_encoding()) value = unicode(value, form.get_form_encoding())
if getattr(value, 'translate', None) is not None: if getattr(value, 'translate', None) is not None:
return "%s" % value return "%s" % value
......
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