[MOV] tools: put _neuter_mimetype from Document app
This method will be used later in other module(s) than Document. Task : 1960733
This commit is contained in:
committed by
svs-odoo
parent
024010bbe1
commit
a56a4f8aee
@@ -177,3 +177,9 @@ else:
|
||||
ms = magic.open(magic.MAGIC_MIME_TYPE)
|
||||
ms.load()
|
||||
guess_mimetype = lambda bin_data, default=None: ms.buffer(bin_data)
|
||||
|
||||
def neuter_mimetype(mimetype, user):
|
||||
wrong_type = 'ht' in mimetype or 'xml' in mimetype or 'svg' in mimetype
|
||||
if wrong_type and not user._is_system():
|
||||
return 'text/plain'
|
||||
return mimetype
|
||||
|
||||
Reference in New Issue
Block a user