mirror of
https://github.com/langgenius/dify.git
synced 2026-04-22 03:37:44 +08:00
Merge branch 'main' into feat/rag-2
This commit is contained in:
@ -18,6 +18,7 @@ from core.file import helpers as file_helpers
|
||||
from core.rag.extractor.extract_processor import ExtractProcessor
|
||||
from extensions.ext_database import db
|
||||
from extensions.ext_storage import storage
|
||||
from libs.helper import extract_tenant_id
|
||||
from models.account import Account
|
||||
from models.enums import CreatorUserRole
|
||||
from models.model import EndUser, UploadFile
|
||||
@ -61,11 +62,7 @@ class FileService:
|
||||
# generate file key
|
||||
file_uuid = str(uuid.uuid4())
|
||||
|
||||
if isinstance(user, Account):
|
||||
current_tenant_id = user.current_tenant_id
|
||||
else:
|
||||
# end_user
|
||||
current_tenant_id = user.tenant_id
|
||||
current_tenant_id = extract_tenant_id(user)
|
||||
|
||||
file_key = "upload_files/" + (current_tenant_id or "") + "/" + file_uuid + "." + extension
|
||||
|
||||
|
||||
Reference in New Issue
Block a user