mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-15 03:46:06 +08:00
Fix: early return when update doc in sdk (#7907)
### What problem does this PR solve? Fix early return when update doc. #7886 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
1239f5afc8
commit
b95747be4c
@ -306,12 +306,11 @@ def update_doc(tenant_id, dataset_id, document_id):
|
|||||||
return get_error_data_result(
|
return get_error_data_result(
|
||||||
f"`chunk_method` {req['chunk_method']} doesn't exist"
|
f"`chunk_method` {req['chunk_method']} doesn't exist"
|
||||||
)
|
)
|
||||||
if doc.parser_id.lower() == req["chunk_method"].lower():
|
|
||||||
return get_result()
|
|
||||||
|
|
||||||
if doc.type == FileType.VISUAL or re.search(r"\.(ppt|pptx|pages)$", doc.name):
|
if doc.type == FileType.VISUAL or re.search(r"\.(ppt|pptx|pages)$", doc.name):
|
||||||
return get_error_data_result(message="Not supported yet!")
|
return get_error_data_result(message="Not supported yet!")
|
||||||
|
|
||||||
|
if doc.parser_id.lower() != req["chunk_method"].lower():
|
||||||
e = DocumentService.update_by_id(
|
e = DocumentService.update_by_id(
|
||||||
doc.id,
|
doc.id,
|
||||||
{
|
{
|
||||||
@ -323,6 +322,7 @@ def update_doc(tenant_id, dataset_id, document_id):
|
|||||||
)
|
)
|
||||||
if not e:
|
if not e:
|
||||||
return get_error_data_result(message="Document not found!")
|
return get_error_data_result(message="Document not found!")
|
||||||
|
if not req.get("parser_config"):
|
||||||
req["parser_config"] = get_parser_config(
|
req["parser_config"] = get_parser_config(
|
||||||
req["chunk_method"], req.get("parser_config")
|
req["chunk_method"], req.get("parser_config")
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user