From b16f16e19e774abfb72be8df69123060ee35a318 Mon Sep 17 00:00:00 2001 From: adam-kobus <77553034+adam-kobus@users.noreply.github.com> Date: Fri, 27 Sep 2024 04:24:46 +0200 Subject: [PATCH] Bug fix - email processing could be run now from API (#2613) ### What problem does this PR solve? If .eml file is uploaded, there is always General method chosen for email processing, even if parsing_method is defined in the request. This change solves this issue. ### Type of change - [X] Bug Fix (non-breaking change which fixes an issue) Co-authored-by: Adam Kobus --- api/apps/api_app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/apps/api_app.py b/api/apps/api_app.py index 017cf49d7..8b11d5623 100644 --- a/api/apps/api_app.py +++ b/api/apps/api_app.py @@ -454,6 +454,8 @@ def upload(): doc["parser_id"] = ParserType.AUDIO.value if re.search(r"\.(ppt|pptx|pages)$", filename): doc["parser_id"] = ParserType.PRESENTATION.value + if re.search(r"\.(eml)$", filename): + doc["parser_id"] = ParserType.EMAIL.value doc_result = DocumentService.insert(doc) FileService.add_file_from_kb(doc, kb_folder["id"], kb.tenant_id)