about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-07-31 09:30:24 +0300
committerFrederick Muriuki Muriithi2023-07-31 09:30:24 +0300
commite3cb6bc3c049c9899b55768c607b71d253d31ca9 (patch)
tree0bb06fc83ae4549366d7cf0f9b52e8d83ad229a1
parentbc3439298074e8139f9d8af8438a224616cf681a (diff)
downloadgenenetwork3-e3cb6bc3c049c9899b55768c607b71d253d31ca9.tar.gz
Fix linting and typing issues.
-rw-r--r--gn3/auth/authorisation/resources/models.py1
-rw-r--r--gn3/auth/authorisation/resources/views.py10
2 files changed, 5 insertions, 6 deletions
diff --git a/gn3/auth/authorisation/resources/models.py b/gn3/auth/authorisation/resources/models.py
index 45d316c..b301a93 100644
--- a/gn3/auth/authorisation/resources/models.py
+++ b/gn3/auth/authorisation/resources/models.py
@@ -268,7 +268,6 @@ def phenotype_resource_data(
         offset: int = 0,
         limit: Optional[int] = None) -> Sequence[sqlite3.Row]:
     """Fetch data linked to a Phenotype resource"""
-    from gn3.debug import __pk__
     cursor.execute(
         ("SELECT * FROM phenotype_resources AS pr "
          "INNER JOIN linked_phenotype_data AS lpd "
diff --git a/gn3/auth/authorisation/resources/views.py b/gn3/auth/authorisation/resources/views.py
index c39d4ab..feacdd6 100644
--- a/gn3/auth/authorisation/resources/views.py
+++ b/gn3/auth/authorisation/resources/views.py
@@ -82,12 +82,12 @@ def __safe_get_requests_page__(key: str = "page") -> int:
 def __safe_get_requests_count__(key: str = "count_per_page") -> int:
     """Get the results page if it exists or default to the first page."""
     try:
-        count = request.args.get(key)
-        if count is None:
-            return None
-        return abs(int(count, base=10))
+        count = request.args.get(key, 0)
+        if count != 0:
+            return abs(int(count, base=10))
+        return 0
     except ValueError as _valerr:
-        return None
+        return 0
 
 @resources.route("/view/<uuid:resource_id>/data")
 @require_oauth("profile group resource")