From 824ccc82d074c57052972ef676ecf598781ca7e4 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 7 Feb 2024 16:23:43 +0300 Subject: ShortName is optional, remove check and set default The ShortName is optional, and can be set to the same value as Name. This commit removes the check that made it mandatory. --- qc_app/upload/rqtl2.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/qc_app/upload/rqtl2.py b/qc_app/upload/rqtl2.py index 69f18fe..9d787e1 100644 --- a/qc_app/upload/rqtl2.py +++ b/qc_app/upload/rqtl2.py @@ -288,16 +288,14 @@ def create_geno_dataset(species_id: int, population_id: int): if not bool(request.form.get("dataset-fullname")): flash("You must provide the dataset full name", errorclasses) return sgeno_page - if not bool(request.form.get("dataset-shortname")): - flash("You must provide the dataset short name", errorclasses) - return sgeno_page public = 2 if request.form.get("dataset-public") == "on" else 0 with conn.cursor(cursorclass=DictCursor) as cursor: + datasetname = request.form["dataset-name"] new_dataset = { - "name": request.form.get("dataset-name"), + "name": datasetname, "fname": request.form.get("dataset-fullname"), - "sname": request.form.get("dataset-shortname"), + "sname": request.form.get("dataset-shortname") or datasetname, "today": date.today().isoformat(), "pub": public, "isetid": population_id -- cgit v1.2.3