From 4b571775234e4a5ff8ce7a212951286affdb527a Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Mon, 9 Sep 2024 14:27:22 +0800 Subject: [PATCH] fix error for files from filemanager (#2323) ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- api/db/services/file2document_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/db/services/file2document_service.py b/api/db/services/file2document_service.py index 71ae12539..9280a0305 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