about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2026-09-10 14:16:30 -0500
committerFrederick Muriuki Muriithi2026-09-10 17:43:07 -0500
commit83d4de83a03ee8b9f4d7bb5cdb9ed457afb136a7 (patch)
treed5329330ab0e44d3a3c2c77f4d03e48607a41b56
parentb1a6d9f5cd8276f637d651602f49d3f829218a9f (diff)
downloadgn-uploader-83d4de83a03ee8b9f4d7bb5cdb9ed457afb136a7.tar.gz
Bugfix: Update links and argument after previous commits.
-rw-r--r--uploader/genotypes/views.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/uploader/genotypes/views.py b/uploader/genotypes/views.py
index c18c330..2a0e0f8 100644
--- a/uploader/genotypes/views.py
+++ b/uploader/genotypes/views.py
@@ -90,8 +90,9 @@ def index(species: dict, population: dict, **kwargs):# pylint: disable=[unused-a
     "/<int:species_id>/populations/<int:population_id>/genotypes/<int:dataset_id>/list-markers",
     methods=["GET"])
 @require_login
-@with_species(redirect_uri="species.populations.genotypes.list_genotypes")
-def list_markers(species: dict, **_kwargs):
+@with_population(species_redirect_uri="species.list_species",
+                 redirect_uri="species.populations.index")
+def list_markers(species: dict, population: dict, **_kwargs):
     """List the markers that exist for this species."""
     args = request.args
     offset = int(args.get("start") or 0)
@@ -99,11 +100,12 @@ def list_markers(species: dict, **_kwargs):
         markers, total_records = genotype_markers(
             conn,
             species["SpeciesId"],
+            population["Id"],
             offset=offset,
             limit=int(args.get("length") or 0))
         return jsonify({
-            **({"draw": int(args.get("draw"))}
-               if bool(args.get("draw") or False)
+            **({"draw": int(args.get("draw", "0"))}
+               if bool(args.get("draw"))
                else {}),
             "recordsTotal": total_records,
             "recordsFiltered": len(markers),
@@ -176,7 +178,7 @@ def create_dataset(species: dict, population: dict, **kwargs):# pylint: disable=
                     form["geno-dataset-name"],
                     form["geno-dataset-fullname"],
                     form["geno-dataset-shortname"]))
-            except Exception:
+            except Exception:# pylint: disable=[broad-exception-caught]
                 msg = "Error adding new Genotype dataset to database."
                 logger.error(msg, exc_info=True)
                 return Left(Exception(msg))