aboutsummaryrefslogtreecommitdiff
path: root/uploader
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-09-24 10:14:17 -0500
committerFrederick Muriuki Muriithi2024-09-24 10:14:17 -0500
commiteb07b9fa8a7249b1d17632a4a73e133e6ac7ea75 (patch)
treed888101fa17887cda9498da4f3ddb228a982fffe /uploader
parentf5d34ea1e30daaabb5ab49735bec4353777c94d9 (diff)
downloadgn-uploader-eb07b9fa8a7249b1d17632a4a73e133e6ac7ea75.tar.gz
Lint: Get rid of extraneous if check.
Diffstat (limited to 'uploader')
-rw-r--r--uploader/genotypes/views.py4
-rw-r--r--uploader/platforms/views.py4
2 files changed, 2 insertions, 6 deletions
diff --git a/uploader/genotypes/views.py b/uploader/genotypes/views.py
index d69dc28..9da4dec 100644
--- a/uploader/genotypes/views.py
+++ b/uploader/genotypes/views.py
@@ -115,9 +115,7 @@ def list_markers(species_id: int):
flash("Invalid species provided!", "alert-danger")
return redirect(url_for("species.populations.genotypes.index"))
- start_from = safe_int(request.args.get("start_from") or 0)
- if start_from < 0:
- start_from = 0
+ start_from = max(safe_int(request.args.get("start_from") or 0), 0)
count = safe_int(request.args.get("count") or 20)
markers = enumerate_sequence(
genotype_markers(conn, species_id, offset=start_from, limit=count),
diff --git a/uploader/platforms/views.py b/uploader/platforms/views.py
index 56390ab..1abf52e 100644
--- a/uploader/platforms/views.py
+++ b/uploader/platforms/views.py
@@ -48,9 +48,7 @@ def list_platforms(species_id: int):
flash("No species provided.", "alert-danger")
return redirect(url_for("species.platforms.index"))
- start_from = safe_int(request.args.get("start_from") or 0)
- if start_from < 0:
- start_from = 0
+ start_from = max(safe_int(request.args.get("start_from") or 0), 0)
count = safe_int(request.args.get("count") or 20)
return render_template(
"platforms/list-platforms.html",