aboutsummaryrefslogtreecommitdiff
path: root/qc_app/upload/rqtl2.py
diff options
context:
space:
mode:
Diffstat (limited to 'qc_app/upload/rqtl2.py')
-rw-r--r--qc_app/upload/rqtl2.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/qc_app/upload/rqtl2.py b/qc_app/upload/rqtl2.py
index c20bd8f..4b00891 100644
--- a/qc_app/upload/rqtl2.py
+++ b/qc_app/upload/rqtl2.py
@@ -183,7 +183,8 @@ def upload_rqtl2_bundle(species_id: int, population_id: int):
{"job-metadata": json.dumps({
"speciesid": species_id,
"populationid": population_id,
- "rqtl2-bundle-file": str(the_file.absolute())})}),
+ "rqtl2-bundle-file": str(the_file.absolute()),
+ "original-filename": request.files["rqtl2_bundle_file"].filename})}),
redisuri,
f"{app.config['UPLOAD_FOLDER']}/job_errors")
return redirect(url_for(
@@ -193,7 +194,8 @@ def upload_rqtl2_bundle(species_id: int, population_id: int):
methods=["GET", "POST"])
def rqtl2_bundle_qc_status(jobid: UUID):
"""Check the status of the QC jobs."""
- with Redis.from_url(app.config["REDIS_URL"], decode_responses=True) as rconn:
+ with (Redis.from_url(app.config["REDIS_URL"], decode_responses=True) as rconn,
+ database_connection(app.config["SQL_URI"]) as dbconn):
try:
thejob = jobs.job(rconn, jobs.jobsnamespace(), jobid)
messagelistname = thejob.get("log-messagelist")
@@ -207,9 +209,15 @@ def rqtl2_bundle_qc_status(jobid: UUID):
thejob.get("errors-generic", "[]")),
messages=logmessages)
if jobstatus == "success":
- return render_template("rqtl2/rqtl2-qc-job-results.html",
- job=thejob,
- messages=logmessages)
+ jobmeta = json.loads(thejob["job-metadata"])
+ species = species_by_id(dbconn, jobmeta["speciesid"])
+ return render_template(
+ "rqtl2/rqtl2-qc-job-results.html",
+ species=species,
+ population=population_by_species_and_id(
+ dbconn, species["SpeciesId"], jobmeta["populationid"]),
+ rqtl2bundle=Path(jobmeta["rqtl2-bundle-file"]),
+ rqtl2bundleorig=jobmeta["original-filename"])
return render_template("rqtl2/rqtl2-qc-job-status.html",
job=thejob,