diff options
| author | Frederick Muriuki Muriithi | 2026-05-20 20:30:57 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2026-05-20 20:30:57 -0500 |
| commit | 22e306bb1107e15318416daa7aee42d2642f16d3 (patch) | |
| tree | b4be9bbf6350eb5e2b80dffb642bbba5a903ef71 /gn_auth/auth | |
| parent | d2f780b931b9a7d4a99578c6ba4dc1f110cda1d1 (diff) | |
| download | gn-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.py | 4 |
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()) |
