about summary refs log tree commit diff
path: root/gn3/auth/authorisation/resources
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-02-28 12:45:57 +0300
committerFrederick Muriuki Muriithi2023-02-28 14:26:17 +0300
commite66e0d24f76458aade54056e18de7d4e0762d06c (patch)
treebbafabc572b3673d747df751ca4e5ec899f95b46 /gn3/auth/authorisation/resources
parentbbd61fc91bd9bdbf41201dd8f609e02ef8339974 (diff)
downloadgenenetwork3-data-access-levels-endpoint.tar.gz
auth: Unlink data from resources data-access-levels-endpoint
Enable the data editor to unlink data from a particular resource.
Diffstat (limited to 'gn3/auth/authorisation/resources')
-rw-r--r--gn3/auth/authorisation/resources/models.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gn3/auth/authorisation/resources/models.py b/gn3/auth/authorisation/resources/models.py
index 13f234f..be1bc17 100644
--- a/gn3/auth/authorisation/resources/models.py
+++ b/gn3/auth/authorisation/resources/models.py
@@ -414,12 +414,12 @@ def __attach_data__(
             **acc,
             resource_id: acc.get(resource_id, tuple()) + (dict(row),)
         }
-    organised = reduce(__organise__, data_rows, {})
+    organised: dict[UUID, tuple[dict, ...]] = reduce(__organise__, data_rows, {})
     return tuple(
         Resource(
             resource.group, resource.resource_id, resource.resource_name,
             resource.resource_category, resource.public,
-            organised[resource.resource_id])
+            organised.get(resource.resource_id, tuple()))
         for resource in resources)
 
 def attach_mrna_resources_data(