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.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),