Commit 0748667c authored by Jérome Perrin's avatar Jérome Perrin

BusinessTemplate: py3 ( obj.data with old bt )

parent e50c8e2d
...@@ -1528,6 +1528,12 @@ class ObjectTemplateItem(BaseTemplateItem): ...@@ -1528,6 +1528,12 @@ class ObjectTemplateItem(BaseTemplateItem):
container.getParentValue().updateCache() container.getParentValue().updateCache()
elif obj.__class__.__name__ in ('File', 'Image'): elif obj.__class__.__name__ in ('File', 'Image'):
if "data" in obj.__dict__: if "data" in obj.__dict__:
# XXX when installing very old business templates without the data stored
# in a separate file (such as the one from
# testTemplateTool.TestTemplateTool.test_updateBusinessTemplateFromUrl_keep_list)
# data might be loaded as a string, fix this here.
if not isinstance(obj.data, (bytes, Pdata)):
obj.data = obj.data.encode()
# XXX Calling obj._setData() would call Interaction Workflow such # XXX Calling obj._setData() would call Interaction Workflow such
# as document_conversion_interaction_workflow which would update # as document_conversion_interaction_workflow which would update
# mime_type too... # mime_type too...
......
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