From d48be5b240e9394955972a4e6aefe97d490b41fb Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 20 Mar 2023 12:12:36 +0300 Subject: oauth2: Pass the offset in the query --- wqflask/wqflask/oauth2/data.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/oauth2/data.py b/wqflask/wqflask/oauth2/data.py index cb9c1000..8005a2a0 100644 --- a/wqflask/wqflask/oauth2/data.py +++ b/wqflask/wqflask/oauth2/data.py @@ -34,7 +34,9 @@ def list_data(): return __render__(**{**groups, **roles}) dataset_type = request.form["dataset_type"] - offset = int(request.form.get("offset", 0)) + offset = int(request.form.get("offset", 0)) + ( + 0 if request.form.get("offset_submit") is None else( + 100 if request.form["offset_submit"] == "Next" else -100)) if dataset_type not in ("mrna", "genotype", "phenotype"): flash("InvalidDatasetType: An invalid dataset type was provided", "alert-danger") @@ -46,7 +48,7 @@ def list_data(): lambda data: {"data_items": data}) return __render__(**{ **groups, **roles, **data_items, "dataset_type": dataset_type, - "offset": (offset if offset >= 100 else 0) + "offset": offset }) @data.route("/link", methods=["POST"]) -- cgit v1.2.3