Commit e522c903 authored by Fabien Morin's avatar Fabien Morin

if no content_type has been set, guess it (not possible to use hasContentType

 as there is a default value on the Data.py property_sheet it is always true


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35649 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9025877d
...@@ -246,7 +246,8 @@ class ContributionTool(BaseTool): ...@@ -246,7 +246,8 @@ class ContributionTool(BaseTool):
# Then edit the document contents (so that upload can happen) # Then edit the document contents (so that upload can happen)
document._edit(**kw) document._edit(**kw)
if not document.hasContentType() and getattr(document, 'guessMimeType', None) is not None: # if no content_type has been set, guess it
if 'content_type' not in kw and getattr(document, 'guessMimeType', None) is not None:
# For File force to setup the mime_type # For File force to setup the mime_type
document.guessMimeType(fname=file_name) document.guessMimeType(fname=file_name)
if url: if url:
......
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