mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
uncompleted and disabled documents can't create segment with api
This commit is contained in:
parent
c8da929904
commit
dc3068da2c
|
@ -36,6 +36,10 @@ class SegmentApi(DatasetApiResource):
|
|||
document = DocumentService.get_document(dataset.id, document_id)
|
||||
if not document:
|
||||
raise NotFound("Document not found.")
|
||||
if document.indexing_status != "completed":
|
||||
raise NotFound("Document is already completed.")
|
||||
if not document.enabled:
|
||||
raise NotFound("Document is disabled.")
|
||||
# check embedding model setting
|
||||
if dataset.indexing_technique == "high_quality":
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue
Block a user