Fix: doc deletion failure with invalid docid. (#6194)

### What problem does this PR solve?

#6174

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu 2025-03-18 10:44:50 +08:00 committed by GitHub
parent 1b130546f8
commit 1b9f63f799
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -600,7 +600,8 @@ def delete(tenant_id, dataset_id):
try:
e, doc = DocumentService.get_by_id(doc_id)
if not e:
return get_error_data_result(message="Document not found!")
errors += f"Document({doc_id}) not found!"
continue
tenant_id = DocumentService.get_tenant_id(doc_id)
if not tenant_id:
return get_error_data_result(message="Tenant not found!")