mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 18:08:07 +08:00
Merge branch 'main' into feat/memory-orchestration-be
This commit is contained in:
@ -2,7 +2,7 @@ from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
import sqlalchemy as sa
|
||||
from celery import states # type: ignore
|
||||
from celery import states
|
||||
from sqlalchemy import DateTime, String
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
|
||||
@ -8,7 +8,6 @@ from typing import TYPE_CHECKING, Any, Optional, Union
|
||||
from uuid import uuid4
|
||||
|
||||
import sqlalchemy as sa
|
||||
from flask_login import current_user
|
||||
from sqlalchemy import DateTime, orm
|
||||
|
||||
from core.file.constants import maybe_file_object
|
||||
@ -24,7 +23,6 @@ from core.workflow.constants import (
|
||||
from core.workflow.nodes.enums import NodeType
|
||||
from factories.variable_factory import TypeMismatchError, build_segment_with_type
|
||||
from libs.datetime_utils import naive_utc_now
|
||||
from libs.helper import extract_tenant_id
|
||||
|
||||
from ._workflow_exc import NodeNotFoundError, WorkflowDataError
|
||||
|
||||
@ -357,8 +355,8 @@ class Workflow(Base):
|
||||
if self._environment_variables is None:
|
||||
self._environment_variables = "{}"
|
||||
|
||||
# Get tenant_id from current_user (Account or EndUser)
|
||||
tenant_id = extract_tenant_id(current_user)
|
||||
# Use workflow.tenant_id to avoid relying on request user in background threads
|
||||
tenant_id = self.tenant_id
|
||||
|
||||
if not tenant_id:
|
||||
return []
|
||||
@ -388,8 +386,8 @@ class Workflow(Base):
|
||||
self._environment_variables = "{}"
|
||||
return
|
||||
|
||||
# Get tenant_id from current_user (Account or EndUser)
|
||||
tenant_id = extract_tenant_id(current_user)
|
||||
# Use workflow.tenant_id to avoid relying on request user in background threads
|
||||
tenant_id = self.tenant_id
|
||||
|
||||
if not tenant_id:
|
||||
self._environment_variables = "{}"
|
||||
|
||||
Reference in New Issue
Block a user