aboutsummaryrefslogtreecommitdiff
path: root/qc_app/upload
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-04-08 09:36:38 +0300
committerFrederick Muriuki Muriithi2024-04-08 09:36:38 +0300
commit186df2bacd11beae53a0c4562e9dcc72c6d253c8 (patch)
treeba01098eb4769af51d11219d843a78a360f5a0c3 /qc_app/upload
parentd904748a0c8c35d937c6e56fadc7ba52b9f43634 (diff)
downloadgn-uploader-186df2bacd11beae53a0c4562e9dcc72c6d253c8.tar.gz
bug: UI: Provide better error messaging.
Diffstat (limited to 'qc_app/upload')
-rw-r--r--qc_app/upload/rqtl2.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/qc_app/upload/rqtl2.py b/qc_app/upload/rqtl2.py
index e0fb40c..876f17c 100644
--- a/qc_app/upload/rqtl2.py
+++ b/qc_app/upload/rqtl2.py
@@ -651,6 +651,7 @@ def create_probeset_study(species_id: int, population_id: int):
methods=["POST"])
def create_probeset_dataset(species_id: int, population_id: int):#pylint: disable=[too-many-return-statements]
"""Create a new probeset dataset."""
+ errorclasses = "alert-error error-rqtl2 error-rqtl2-create-probeset-dataset"
with database_connection(app.config["SQL_URI"]) as conn:
def __thunk__():
form = request.form
@@ -659,23 +660,23 @@ def create_probeset_dataset(species_id: int, population_id: int):#pylint: disabl
population_id=population_id),
code=307)
if not bool(form.get("averageid")):
- flash("Averaging method not selected!", "alert-error error-rqtl2")
+ flash("Averaging method not selected!", errorclasses)
return summary_page
if not bool(form.get("datasetname")):
- flash("Dataset name not provided!", "alert-error error-rqtl2")
+ flash("Dataset name not provided!", errorclasses)
return summary_page
if not bool(form.get("datasetfullname")):
- flash("Dataset full name not provided!", "alert-error error-rqtl2")
+ flash("Dataset full name not provided!", errorclasses)
return summary_page
study = probeset_study_by_id(conn, int(form["probe-study-id"]))
if not bool(study):
- flash("Invalid ProbeSet study provided!", "alert-error error-rqtl2")
+ flash("Invalid ProbeSet study provided!", errorclasses)
return summary_page
avgmethod = averaging_method_by_id(conn, int(form["averageid"]))
if not bool(avgmethod):
- flash("Invalid averaging method provided!", "alert-error error-rqtl2")
+ flash("Invalid averaging method provided!", errorclasses)
return summary_page
try:
@@ -691,14 +692,14 @@ def create_probeset_dataset(species_id: int, population_id: int):#pylint: disabl
except mdb.IntegrityError as _ierr:
flash(("A dataset with that name already exists. Try selecting "
"from list of datasets instead."),
- "alert-error error-rqtl2")
+ errorclasses)
return summary_page
except Exception as _exc:
app.logger.debug("Error creating ProbeSet dataset: %s",
traceback.format_exc())
flash(("There was a problem creating your dataset. Please try "
"again."),
- "alert-error error-rqtl2")
+ errorclasses)
return render_template(
"rqtl2/create-probe-dataset-success.html",
species=species_by_id(conn, species_id),