about summary refs log tree commit diff
path: root/uploader/phenotypes/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/phenotypes/views.py')
-rw-r--r--uploader/phenotypes/views.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py
index 79aab81..f23b377 100644
--- a/uploader/phenotypes/views.py
+++ b/uploader/phenotypes/views.py
@@ -366,3 +366,30 @@ def add_phenotypes(species: dict, population: dict, dataset: dict, **kwargs):# p
         #     f"{app.config['UPLOAD_FOLDER']}/job_errors")
 
     raise NotImplementedError("Please implement this...")
+
+
+@phenotypesbp.route(
+    "<int:species_id>/populations/<int:population_id>/phenotypes/datasets"
+    "/<int:dataset_id>/job/<uuid:job_id>",
+    methods=["GET"])
+@require_login
+@with_dataset(
+    species_redirect_uri="species.populations.phenotypes.index",
+    population_redirect_uri="species.populations.phenotypes.select_population",
+    redirect_uri="species.populations.phenotypes.list_datasets")
+def job_status(species: dict, population: dict, dataset: dict, job_id: uuid, **kwargs):
+    """Retrieve current status of a particular phenotype QC job."""
+    from uploader.debug import __pk__
+
+    with Redis.from_url(app.config["REDIS_URL"], decode_responses=True) as rconn:
+        try:
+            job = jobs.job(rconn, jobs.jobsnamespace(), str(job_id))
+        except jobs.JobNotFound as _jnf:
+            job = None
+        return render_template("phenotypes/job-status.html",
+                               species=species,
+                               population=population,
+                               dataset=dataset,
+                               job_id=job_id,
+                               job=job,
+                               activelink="add-phenotypes")