From d453f607ffa5d3a7c6dde31e16b0f4cbb7cbb069 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 26 Sep 2023 03:11:45 +0300 Subject: Handle temporary edge cases Fetching resource data: system and group categories of resources do not have associated genetic data. This commit adds some code to temporarily handle that case as an edge case before I can devote more time to fixing the issue in a much better way. --- gn_auth/auth/authorisation/resources/groups/views.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gn_auth/auth/authorisation/resources/groups') diff --git a/gn_auth/auth/authorisation/resources/groups/views.py b/gn_auth/auth/authorisation/resources/groups/views.py index f146ffd..ba34040 100644 --- a/gn_auth/auth/authorisation/resources/groups/views.py +++ b/gn_auth/auth/authorisation/resources/groups/views.py @@ -233,6 +233,9 @@ def unlinked_phenotype_data( @require_oauth("profile group resource") def unlinked_data(resource_type: str) -> Response: """View data linked to the group but not linked to any resource.""" + if resource_type in ("system", "group"): + return jsonify(tuple()) + if resource_type not in ("all", "mrna", "genotype", "phenotype"): raise AuthorisationError(f"Invalid resource type {resource_type}") -- cgit v1.2.3