Skip to content

Commit

Permalink
fix: remove name comparison
Browse files Browse the repository at this point in the history
Signed-off-by: 35C4n0r <[email protected]>
  • Loading branch information
35C4n0r committed Sep 27, 2024
1 parent d5dbd79 commit 52cb6cd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion keep/api/core/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ def get_workflow(tenant_id: str, workflow_id: str) -> Workflow:
workflow = session.exec(
select(Workflow)
.where(Workflow.tenant_id == tenant_id)
.where(Workflow.name == workflow_id)
.where(Workflow.id == workflow_id)
.where(Workflow.is_deleted == False)
).first()
if not workflow:
Expand Down
5 changes: 4 additions & 1 deletion keep/api/routes/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,10 @@ async def __get_workflow_raw_data(
is_valid = True
except Exception as e:
is_valid = False
logger.error(f"Error while validating workflow yaml {workflow_data['id']}", extra={"exception": e})
logger.error(
f"Error while validating workflow yaml {workflow_data['id']}",
extra={"exception": e},
)

return workflow_data, is_valid

Expand Down
5 changes: 4 additions & 1 deletion keep/workflowmanager/workflowstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,10 @@ def provision_workflows_from_directory(
tenant_id=tenant_id, parsed_workflow_yaml=workflow_yaml
)
except Exception as e:
logger.error(f"Error while validating workflow yaml {workflow_id}", extra={"exception": e})
logger.error(
f"Error while validating workflow yaml {workflow_id}",
extra={"exception": e},
)
is_valid = False
add_or_update_workflow(
id=workflow_id,
Expand Down

0 comments on commit 52cb6cd

Please sign in to comment.