Commit e4acb001 authored by Nicolas Delaby's avatar Nicolas Delaby

Disable feature added by recent version of OFS.Image which try to guess

the content_type by reading the id of object.
In ERP5, the content_type is reads from filename property thanks to 
interaction_workflow


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41123 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2c471817
...@@ -128,6 +128,16 @@ class File(Document, CMFFile): ...@@ -128,6 +128,16 @@ class File(Document, CMFFile):
getcontentlength = get_size getcontentlength = get_size
def _get_content_type(*args, **kw):
"""Override original implementation from OFS/Image.py
to disable content_type discovery because
id of object its used to read the filename value.
In ERP5, an interaction
document_conversion_interaction_workflow/Document_file,
update the content_type by reading filename property
"""
return None
def _setFile(self, data, precondition=None): def _setFile(self, data, precondition=None):
if data is not None and self.hasData() and \ if data is not None and self.hasData() and \
md5.md5(str(data.read())).digest() ==\ md5.md5(str(data.read())).digest() ==\
......
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