feat: simplify TesterPanel design

This commit is contained in:
Abhishek Kumar 2026-05-19 08:24:39 +05:30
parent f929a332bb
commit b243e97502
15 changed files with 2461 additions and 565 deletions

View file

@ -60,8 +60,8 @@ class WorkflowRunTextSessionClient(BaseDBClient):
async def get_workflow_run_text_session(
self,
workflow_run_id: int,
user_id: int | None = None,
organization_id: int | None = None,
*,
organization_id: int,
) -> WorkflowRunTextSessionModel | None:
async with self.async_session() as session:
query = (
@ -74,13 +74,9 @@ class WorkflowRunTextSessionClient(BaseDBClient):
.join(WorkflowRunTextSessionModel.workflow_run)
.join(WorkflowRunModel.workflow)
.where(WorkflowRunTextSessionModel.workflow_run_id == workflow_run_id)
.where(WorkflowModel.organization_id == organization_id)
)
if organization_id is not None:
query = query.where(WorkflowModel.organization_id == organization_id)
elif user_id is not None:
query = query.where(WorkflowModel.user_id == user_id)
result = await session.execute(query)
return result.scalars().first()