Skip to content
Snippets Groups Projects
Commit 0a5335d0 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Add workflow invocation status

parent e4f1fdea
No related branches found
No related tags found
1 merge request!74Resolve "select workflow to run"
Pipeline #66456 canceled
......@@ -30,7 +30,7 @@ from .managers import (
PhenotypeCategoryManager,
)
from .galaxy import GalaxyRunner, get_history_status
from .galaxy import GalaxyRunner, get_history_status, get_workflow_invocation_status
from .exceptions import RessourceAlreadyExists
# Create your models here.
......@@ -161,7 +161,9 @@ class Experiment(models.Model):
Line_F=models.F("experiment_cc_line__cc_line_f__id_cc"),
Sex=models.F("experiment_cc_line__sex"),
)
.values("id", "CC_ID", "value", "phenotype_type", "Line_M", "Line_F", "Sex",)
.values(
"id", "CC_ID", "value", "phenotype_type", "Line_M", "Line_F", "Sex",
)
)
df_phenotypes = pd.DataFrame(data=phenotypes)
......@@ -639,14 +641,29 @@ class Analysis(models.Model):
@property
def history_status(self):
try:
history_status = get_history_status(self.galaxy_history_id)
return history_status
except ConnectionError:
if self.galaxy_history_id:
try:
history_status = get_history_status(self.galaxy_history_id)
return history_status
except ConnectionError:
return None
else:
return None
def get_workflow_job_params(self):
@property
def workflow_invocation_status(self):
if self.galaxy_workflow_invocation_id:
try:
status = get_workflow_invocation_status(
self.galaxy_workflow_id, self.galaxy_workflow_invocation_id
)
return status
except ConnectionError:
return None
else:
return None
def get_workflow_job_params(self):
runner = GalaxyRunner()
gi = runner.galaxy_instance
invocation = gi.workflows.show_invocation(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment