refactor: select in 13 small service files (#34371)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Renzo
2026-04-01 06:00:05 +02:00
committed by GitHub
parent 42d7623cc6
commit beda78e911
16 changed files with 72 additions and 102 deletions

View File

@@ -4,6 +4,7 @@ import uuid
from datetime import UTC, datetime
from redis import RedisError
from sqlalchemy import select
from configs import dify_config
from extensions.ext_database import db
@@ -104,7 +105,9 @@ def sync_account_deletion(account_id: str, *, source: str) -> bool:
return True
# Fetch all workspaces the account belongs to
workspace_joins = db.session.query(TenantAccountJoin).filter_by(account_id=account_id).all()
workspace_joins = db.session.scalars(
select(TenantAccountJoin).where(TenantAccountJoin.account_id == account_id)
).all()
# Queue sync task for each workspace
success = True