aboutsummaryrefslogtreecommitdiff
path: root/qc_app
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-03-04 10:59:56 +0300
committerFrederick Muriuki Muriithi2024-03-04 10:59:56 +0300
commit417887a81d9f58f4cca8bb25dbd2f21178a5a6f2 (patch)
tree8d97ddf86dd34f4daa8fb5d7125306a8d63c6ca1 /qc_app
parent77eeaec1ecdef5f110c69aa767969649e353b22b (diff)
downloadgn-uploader-417887a81d9f58f4cca8bb25dbd2f21178a5a6f2.tar.gz
Display flash messages correctly.
Diffstat (limited to 'qc_app')
-rw-r--r--qc_app/parse.py15
-rw-r--r--qc_app/templates/index.html2
2 files changed, 9 insertions, 8 deletions
diff --git a/qc_app/parse.py b/qc_app/parse.py
index f0c53d1..ba2e63e 100644
--- a/qc_app/parse.py
+++ b/qc_app/parse.py
@@ -30,7 +30,7 @@ def parse():
filename = request.args.get("filename")
filetype = request.args.get("filetype")
if speciesid is None:
- flash("No species selected", "alert-error")
+ flash("No species selected", "alert-error alert-expr-data-error")
errors = True
else:
try:
@@ -38,29 +38,30 @@ def parse():
species = with_db_connection(
lambda con: species_by_id(con, speciesid))
if not bool(species):
- flash("No such species.", "alert-error")
+ flash("No such species.", "alert-error alert-expr-data-error")
errors = True
except ValueError:
flash("Invalid speciesid provided. Expected an integer.",
- "alert-error")
+ "alert-error alert-expr-data-error")
errors = True
if filename is None:
- flash("No file provided", "alert-error")
+ flash("No file provided", "alert-error alert-expr-data-error")
errors = True
if filetype is None:
- flash("No filetype provided", "alert-error")
+ flash("No filetype provided", "alert-error alert-expr-data-error")
errors = True
if filetype not in ("average", "standard-error"):
- flash("Invalid filetype provided", "alert-error")
+ flash("Invalid filetype provided", "alert-error alert-expr-data-error")
errors = True
if filename:
filepath = os.path.join(app.config["UPLOAD_FOLDER"], filename)
if not os.path.exists(filepath):
- flash("Selected file does not exist (any longer)", "alert-error")
+ flash("Selected file does not exist (any longer)",
+ "alert-error alert-expr-data-error")
errors = True
if errors:
diff --git a/qc_app/templates/index.html b/qc_app/templates/index.html
index 588133a..b87a67f 100644
--- a/qc_app/templates/index.html
+++ b/qc_app/templates/index.html
@@ -59,7 +59,7 @@
enctype="multipart/form-data"
id="frm-upload-expression-data">
<legend class="heading">upload expression data</legend>
- {{flash_messages("error-expr-data")}}
+ {{flash_messages("error-expr-data-error")}}
<fieldset>
<label for="select_species01">Species</label>