mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-16 08:25:18 +02:00
feat: simplify TesterPanel design
This commit is contained in:
parent
f929a332bb
commit
b243e97502
15 changed files with 2461 additions and 565 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue