about summary refs log tree commit diff
path: root/uploader/genotypes
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/genotypes')
-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))