fix: Empty knowledge base upload error (#1904)

This commit is contained in:
shaohuzhang1 2024-12-25 10:53:43 +08:00 committed by GitHub
parent 0cae0c865b
commit 2db86169fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1046,7 +1046,7 @@ class DocumentSerializers(ApiMixin, serializers.Serializer):
# 查询文档
query_set = QuerySet(model=Document)
if len(document_model_list) == 0:
return [],
return [], dataset_id
query_set = query_set.filter(**{'id__in': [d.id for d in document_model_list]})
return native_search(query_set, select_string=get_file_content(
os.path.join(PROJECT_DIR, "apps", "dataset", 'sql', 'list_document.sql')),