adam-kobus
Adam Kobus
commited on
Commit
·
e195b4d
1
Parent(s):
a57190d
Bug fix - email processing could be run now from API (#2613)
Browse files### 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 <[email protected]>
- api/apps/api_app.py +2 -0
api/apps/api_app.py
CHANGED
@@ -454,6 +454,8 @@ def upload():
|
|
454 |
doc["parser_id"] = ParserType.AUDIO.value
|
455 |
if re.search(r"\.(ppt|pptx|pages)$", filename):
|
456 |
doc["parser_id"] = ParserType.PRESENTATION.value
|
|
|
|
|
457 |
|
458 |
doc_result = DocumentService.insert(doc)
|
459 |
FileService.add_file_from_kb(doc, kb_folder["id"], kb.tenant_id)
|
|
|
454 |
doc["parser_id"] = ParserType.AUDIO.value
|
455 |
if re.search(r"\.(ppt|pptx|pages)$", filename):
|
456 |
doc["parser_id"] = ParserType.PRESENTATION.value
|
457 |
+
if re.search(r"\.(eml)$", filename):
|
458 |
+
doc["parser_id"] = ParserType.EMAIL.value
|
459 |
|
460 |
doc_result = DocumentService.insert(doc)
|
461 |
FileService.add_file_from_kb(doc, kb_folder["id"], kb.tenant_id)
|