diff options
| author | Frederick Muriuki Muriithi | 2026-03-27 10:09:47 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2026-03-27 10:33:18 -0500 |
| commit | 8ec91b6e50fe7f103ab3c10ab7dea89822ff051f (patch) | |
| tree | 75447ccf4a915b5ac448a77442813dff5f5ba347 | |
| parent | 71e36e19dde7fdb8c4b47a81e3e5e2548d185261 (diff) | |
| download | gn-uploader-8ec91b6e50fe7f103ab3c10ab7dea89822ff051f.tar.gz | |
genotypes: Move "GET" handling out of context manager.
| -rw-r--r-- | uploader/genotypes/views.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/uploader/genotypes/views.py b/uploader/genotypes/views.py index 6ffead7..335fc6b 100644 --- a/uploader/genotypes/views.py +++ b/uploader/genotypes/views.py @@ -129,13 +129,14 @@ def view_dataset(species_id: int, population_id: int, dataset_id: int): redirect_uri="species.populations.list_species_populations") def create_dataset(species: dict, population: dict, **kwargs):# pylint: disable=[unused-argument] """Create a genotype dataset.""" + if request.method == "GET": + return render_template("genotypes/create-dataset.html", + species=species, + population=population, + activelink="create-dataset") + with (database_connection(app.config["SQL_URI"]) as conn, conn.cursor(cursorclass=DictCursor) as cursor): - if request.method == "GET": - return render_template("genotypes/create-dataset.html", - species=species, - population=population, - activelink="create-dataset") form = request.form new_dataset = save_new_dataset( |
