From e66e0d24f76458aade54056e18de7d4e0762d06c Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 28 Feb 2023 12:45:57 +0300 Subject: auth: Unlink data from resources Enable the data editor to unlink data from a particular resource. --- gn3/auth/authorisation/resources/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gn3/auth/authorisation/resources') 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( -- cgit v1.2.3