Kevin Hu
commited on
Commit
·
9c8835b
1
Parent(s):
65da567
fix error for files from filemanager (#2323)
Browse files### 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
CHANGED
@@ -76,7 +76,7 @@ class File2DocumentService(CommonService):
|
|
76 |
f2d = cls.get_by_file_id(file_id)
|
77 |
if f2d:
|
78 |
file = File.get_by_id(f2d[0].file_id)
|
79 |
-
if file.source_type == FileSource.LOCAL:
|
80 |
return file.parent_id, file.location
|
81 |
doc_id = f2d[0].document_id
|
82 |
|
|
|
76 |
f2d = cls.get_by_file_id(file_id)
|
77 |
if f2d:
|
78 |
file = File.get_by_id(f2d[0].file_id)
|
79 |
+
if not file.source_type or file.source_type == FileSource.LOCAL:
|
80 |
return file.parent_id, file.location
|
81 |
doc_id = f2d[0].document_id
|
82 |
|