From c542cecda4c7c21bde7668f19a1b3e20f9a2b7b9 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 26 Sep 2024 11:33:38 -0500 Subject: Send the dataset ID. Fix bugs. --- uploader/genotypes/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/uploader/genotypes/views.py b/uploader/genotypes/views.py index 7b5994e..9f08ca6 100644 --- a/uploader/genotypes/views.py +++ b/uploader/genotypes/views.py @@ -1,4 +1,5 @@ """Views for the genotypes.""" +from requests.models import Response from MySQLdb.cursors import DictCursor from flask import (flash, request, @@ -171,7 +172,7 @@ def create_dataset(species: dict, population: dict, **kwargs):# pylint: disable= activelink="create-dataset") form = request.form - _new_dataset = save_new_dataset( + new_dataset = save_new_dataset( cursor, population["Id"], form["geno-dataset-name"], @@ -179,7 +180,7 @@ def create_dataset(species: dict, population: dict, **kwargs):# pylint: disable= form["geno-dataset-shortname"]) def __success__(_success): - flash("Successfully created genotype dataset." "alert-success") + flash("Successfully created genotype dataset.", "alert-success") return redirect(url_for( "species.populations.genotypes.list_genotypes", species_id=species["SpeciesId"], @@ -206,6 +207,7 @@ def create_dataset(species: dict, population: dict, **kwargs):# pylint: disable= **dict(request.form), "species_id": species["SpeciesId"], "population_id": population["Id"], + "dataset_id": new_dataset["Id"], "dataset_name": form["geno-dataset-name"], "dataset_fullname": form["geno-dataset-fullname"], "dataset_shortname": form["geno-dataset-shortname"], -- cgit v1.2.3