aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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")