Skip to content

Commit

Permalink
utils: return different message when deleting all the workflow runs
Browse files Browse the repository at this point in the history
Change the `delete_workflow` function so that when the deletion of a
workflow includes all its runs, then this is mentioned in the `message`
property returned.

Closes #531.
  • Loading branch information
giuseppe-steduto committed Oct 25, 2023
1 parent a18032f commit da6c7b1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion reana_workflow_controller/rest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,16 @@ def delete_workflow(workflow, all_runs=False, workspace=False):
_mark_workflow_as_deleted_in_db(workflow)
remove_workflow_jobs_from_cache(workflow)

if all_runs:
message = "All workflows named {0} successfully deleted.".format(
workflow.name
)
else:
message = "Workflow successfully deleted."
return (
jsonify(
{
"message": "Workflow successfully deleted",
"message": message,
"workflow_id": workflow.id_,
"workflow_name": get_workflow_name(workflow),
"status": workflow.status.name,
Expand Down

0 comments on commit da6c7b1

Please sign in to comment.