Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error for files from filemanager #2323

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/apps/file_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def upload():
"size": len(blob),
}
file = FileService.insert(file)
MINIO.put(last_folder.id, location, blob)
STORAGE_IMPL.put(last_folder.id, location, blob)
file_res.append(file.to_json())
return get_json_result(data=file_res)
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion api/db/services/file2document_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def get_minio_address(cls, doc_id=None, file_id=None):
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

Expand Down