about summary refs log tree commit diff
path: root/gn_auth/auth
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2026-05-20 20:30:57 -0500
committerFrederick Muriuki Muriithi2026-05-20 20:30:57 -0500
commit22e306bb1107e15318416daa7aee42d2642f16d3 (patch)
treeb4be9bbf6350eb5e2b80dffb642bbba5a903ef71 /gn_auth/auth
parentd2f780b931b9a7d4a99578c6ba4dc1f110cda1d1 (diff)
downloadgn-auth-22e306bb1107e15318416daa7aee42d2642f16d3.tar.gz
Raise a NotFoundError if not a single resource is found.
Diffstat (limited to 'gn_auth/auth')
-rw-r--r--gn_auth/auth/authorisation/data/views.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/gn_auth/auth/authorisation/data/views.py b/gn_auth/auth/authorisation/data/views.py
index 502c802..ef3d119 100644
--- a/gn_auth/auth/authorisation/data/views.py
+++ b/gn_auth/auth/authorisation/data/views.py
@@ -132,6 +132,10 @@ def authorisation() -> Response:
                         authconn, _dset_traits["ProbeSet"]))
             for _rrow in _rtypes
         }
+        if len(_all_resources.keys()) == 0:
+            raise NotFoundError(
+                "No resource(s) found for specified trait(s). Do(es) the "
+                "trait(s) actually exist?")
         _resource_ids = tuple(_all_resources.keys())