aboutsummaryrefslogtreecommitdiff
path: root/qc_app
diff options
context:
space:
mode:
Diffstat (limited to 'qc_app')
-rw-r--r--qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html6
-rw-r--r--qc_app/templates/rqtl2/upload-rqtl2-bundle-step-02.html3
-rw-r--r--qc_app/upload/rqtl2.py10
3 files changed, 11 insertions, 8 deletions
diff --git a/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html b/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html
index 6491e6b..64fcdcd 100644
--- a/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html
+++ b/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html
@@ -1,5 +1,5 @@
{%extends "base.html"%}
-{%from "flash_messages.html" import flash_messages%}
+{%from "flash_messages.html" import flash_all_messages%}
{%block title%}Upload R/qtl2 Bundle{%endblock%}
@@ -16,12 +16,12 @@
<input type="hidden" name="population_id"
value="{{population.InbredSetId}}" />
- {{flash_messages("error-rqtl2")}}
+ {{flash_all_messages()}}
<fieldset>
<legend>file upload</legend>
<label for="file:rqtl2-bundle">R/qtl2 bundle</label>
- <input type="file" id="file:rqtl2-bundle" name="rqtl2_bundle"
+ <input type="file" id="file:rqtl2-bundle" name="rqtl2_bundle_file"
accept="application/zip, .zip"
required="required" />
<span class="form-input-help"><p>Provide a valid R/qtl2 zip file here. In
diff --git a/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-02.html b/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-02.html
index 9269a3c..01721e9 100644
--- a/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-02.html
+++ b/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-02.html
@@ -1,5 +1,5 @@
{%extends "base.html"%}
-{%from "flash_messages.html" import flash_messages%}
+{%from "flash_messages.html" import flash_all_messages%}
{%block title%}Upload R/qtl2 Bundle{%endblock%}
@@ -20,6 +20,7 @@
population_id=population.InbredSetId)}}"
method="POST"
enctype="multipart/form-data">
+ {{flash_all_messages()}}
<input type="hidden" name="species_id" value="{{species.SpeciesId}}" />
<input type="hidden" name="population_id"
value="{{population.InbredSetId}}" />
diff --git a/qc_app/upload/rqtl2.py b/qc_app/upload/rqtl2.py
index eea49e1..2d032f8 100644
--- a/qc_app/upload/rqtl2.py
+++ b/qc_app/upload/rqtl2.py
@@ -18,6 +18,8 @@ from flask import (
current_app as app)
from r_qtl import r_qtl2
+from r_qtl import errors as rqe
+from r_qtl import r_qtl2_qc as rqc
from r_qtl.errors import InvalidFormat
from qc_app import jobs
@@ -157,11 +159,11 @@ def upload_rqtl2_bundle(species_id: int, population_id: int):
species=species,
population=population)
- if not bool(request.files.get("rqtl2_bundle")):
+ if not bool(request.files.get("rqtl2_bundle_file")):
raise __RequestError__("No R/qtl2 zip bundle provided.")
- the_file = save_file(
- request.files["rqtl2_bundle"], Path(app.config["UPLOAD_FOLDER"]))
+ the_file = save_file(request.files["rqtl2_bundle_file"],
+ Path(app.config["UPLOAD_FOLDER"]))
if not bool(the_file):
raise __RequestError__("Please provide a valid R/qtl2 zip bundle.")
@@ -170,7 +172,7 @@ def upload_rqtl2_bundle(species_id: int, population_id: int):
try:
with ZipFile(str(the_file), "r") as zfile:
- r_qtl2.validate_bundle(zfile)
+ rqc.validate_bundle(zfile)
return render_template(
"rqtl2/upload-rqtl2-bundle-step-02.html",
species=species,