Commit 87084ab5 authored by Tristan Cavelier's avatar Tristan Cavelier

erp5_base: guessMimeType: set only if necessary

parent fd5818e7
...@@ -4,5 +4,8 @@ portal = document.getPortalObject() ...@@ -4,5 +4,8 @@ portal = document.getPortalObject()
filename = document.getFilename() filename = document.getFilename()
content_type = portal.mimetypes_registry.lookupExtension(filename) content_type = portal.mimetypes_registry.lookupExtension(filename)
if content_type is not None: if content_type is None:
document.setContentType(str(content_type)) return
content_type = str(content_type)
if content_type != document.getContentType():
document.setContentType(content_type)
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