use deco to avoid current_user (#26077)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Asuka Minato
2025-10-16 15:45:51 +09:00
committed by GitHub
parent bd01af6415
commit cced33d068
109 changed files with 526 additions and 788 deletions

View File

@@ -24,7 +24,7 @@ from core.model_runtime.utils.encoders import jsonable_encoder
from extensions.ext_redis import redis_client
if TYPE_CHECKING:
from models.account import Account
from models import Account
from models.model import EndUser
logger = logging.getLogger(__name__)
@@ -43,7 +43,7 @@ def extract_tenant_id(user: Union["Account", "EndUser"]) -> str | None:
Raises:
ValueError: If user is neither Account nor EndUser
"""
from models.account import Account
from models import Account
from models.model import EndUser
if isinstance(user, Account):
@@ -78,7 +78,7 @@ class AvatarUrlField(fields.Raw):
if obj is None:
return None
from models.account import Account
from models import Account
if isinstance(obj, Account) and obj.avatar is not None:
return file_helpers.get_signed_file_url(obj.avatar)