Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix error for files from filemanager (#2323)

Kevin Hu4b571775234e
diff --git a/api/db/services/file2document_service.py b/api/db/services/file2document_service.py
index 71ae12539b..9280a03058 100644
--- a/api/db/services/file2document_service.py
+++ b/api/db/services/file2document_service.py
@@ -76,7 +76,7 @@ class File2DocumentService(CommonService):
f2d = cls.get_by_file_id(file_id)
if f2d:
file = File.get_by_id(f2d[0].file_id)
- if file.source_type == FileSource.LOCAL:
+ if not file.source_type or file.source_type == FileSource.LOCAL:
return file.parent_id, file.location
doc_id = f2d[0].document_id