mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-24 17:38:42 -06:00
[FIX] ignore files with unknown mimetype
This commit is contained in:
parent
e5b00ee0d2
commit
60fb31e29f
@ -18,7 +18,7 @@ class IrAttachment(models.Model):
|
|||||||
def _index(self, data, datas_fname, file_type):
|
def _index(self, data, datas_fname, file_type):
|
||||||
mimetype, content = super(IrAttachment, self)._index(
|
mimetype, content = super(IrAttachment, self)._index(
|
||||||
data, datas_fname, file_type)
|
data, datas_fname, file_type)
|
||||||
if not content or content == 'image':
|
if mimetype and (not content or content == 'image'):
|
||||||
has_synchr_param = self.env['ir.config_parameter'].get_param(
|
has_synchr_param = self.env['ir.config_parameter'].get_param(
|
||||||
'document_ocr.synchronous', 'False') == 'True'
|
'document_ocr.synchronous', 'False') == 'True'
|
||||||
has_force_flag = self.env.context.get('document_ocr_force')
|
has_force_flag = self.env.context.get('document_ocr_force')
|
||||||
|
Loading…
Reference in New Issue
Block a user