fix: use account id in workflow app log filter (#26811)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
This commit is contained in:
hj24
2025-10-14 14:32:40 +08:00
committed by GitHub
parent 9e3b4dc90d
commit 15a5ba67f1
2 changed files with 49 additions and 19 deletions

View File

@@ -86,12 +86,16 @@ class WorkflowAppService:
),
)
if created_by_account:
account = session.scalar(select(Account).where(Account.email == created_by_account))
if not account:
raise ValueError(f"Account not found: {created_by_account}")
stmt = stmt.join(
Account,
and_(
WorkflowAppLog.created_by == Account.id,
WorkflowAppLog.created_by_role == CreatorUserRole.ACCOUNT,
Account.email == created_by_account,
Account.id == account.id,
),
)