Skip to content

Commit

Permalink
Merge 7b54cca into d1b14ee
Browse files Browse the repository at this point in the history
  • Loading branch information
audrium committed Oct 22, 2020
2 parents d1b14ee + 7b54cca commit 3d18d99
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion reana_workflow_controller/rest/workflows_session.py
Expand Up @@ -11,7 +11,7 @@

from flask import Blueprint, jsonify, request
from reana_db.utils import _get_workflow_with_uuid_or_name
from reana_db.models import WorkflowSession, InteractiveSessionType
from reana_db.models import WorkflowSession, InteractiveSessionType, RunStatus

from reana_workflow_controller.workflow_run_manager import KubernetesWorkflowRunManager

Expand Down Expand Up @@ -125,6 +125,17 @@ def open_interactive_session(workflow_id_or_name, interactive_session_type): #
user_uuid = request.args["user"]
workflow = None
workflow = _get_workflow_with_uuid_or_name(workflow_id_or_name, user_uuid)

if workflow.status == RunStatus.deleted:
return (
jsonify(
{
"message": "Interactive session can't be opened from a deleted workflow"
}
),
404,
)

kwrm = KubernetesWorkflowRunManager(workflow)
access_path = kwrm.start_interactive_session(
interactive_session_type,
Expand Down

0 comments on commit 3d18d99

Please sign in to comment.