From 22e306bb1107e15318416daa7aee42d2642f16d3 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 20 May 2026 20:30:57 -0500 Subject: Raise a NotFoundError if not a single resource is found. --- gn_auth/auth/authorisation/data/views.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gn_auth/auth') 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()) -- cgit 1.4.1