diff options
Diffstat (limited to 'qc_app/upload/rqtl2.py')
-rw-r--r-- | qc_app/upload/rqtl2.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/qc_app/upload/rqtl2.py b/qc_app/upload/rqtl2.py index 60aeba7..860a6a9 100644 --- a/qc_app/upload/rqtl2.py +++ b/qc_app/upload/rqtl2.py @@ -13,6 +13,7 @@ from redis import Redis from MySQLdb.cursors import DictCursor from flask import ( flash, + escape, request, url_for, redirect, @@ -453,6 +454,19 @@ def create_geno_dataset(species_id: int, population_id: int): "pub": public, "isetid": population_id } + cursor.execute("SELECT * FROM GenoFreeze WHERE Name=%s", + (datasetname,)) + results = cursor.fetchall() + if bool(results): + flash( + f"A genotype dataset with name '{escape(datasetname)}' " + "already exists.", + errorclasses) + return redirect(url_for("upload.rqtl2.select_dataset_info", + species_id=species_id, + population_id=population_id, + pgsrc="error"), + code=307) cursor.execute( "INSERT INTO GenoFreeze(" "Name, FullName, ShortName, CreateTime, public, InbredSetId" |