From 4ba0d9c26d8d5dd9e2ac690a5aa69468b5e01282 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Tue, 30 Apr 2024 10:58:29 +0300 Subject: Use a dataset's label instead of it's id when fetching auth details. * gn2/wqflask/views.py (get_dataset): Use a dataset's label as it's identifier. Signed-off-by: Munyoki Kilyungi --- gn2/wqflask/views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gn2/wqflask') diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py index c126524b..eb741701 100644 --- a/gn2/wqflask/views.py +++ b/gn2/wqflask/views.py @@ -1223,9 +1223,8 @@ def get_dataset(name): GN3_LOCAL_URL, f"/api/metadata/datasets/{name}") ).json() - id_ = metadata.get("id", "").split("/")[-1] result = oauth2_get( - f"auth/resource/authorisation/{id_}" + f"auth/resource/authorisation/{metadata.get('label')}" ).either( lambda err: {"roles": []}, lambda val: val -- cgit v1.2.3