aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/auth/authorisation/resources/genotype_resource.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-09-13 11:23:45 +0300
committerFrederick Muriuki Muriithi2023-09-26 03:44:30 +0300
commit37771b3be3142f705101beb4c5dc34c1000962f9 (patch)
treefce04cba9f99144d7893d30cd5a4d1ffb8823e8d /gn_auth/auth/authorisation/resources/genotype_resource.py
parentdd759423739dafebe1d2ce7adb9fc1230ae0ee9d (diff)
downloadgn-auth-37771b3be3142f705101beb4c5dc34c1000962f9.tar.gz
Remove group from resource objects
With the new schema, not all Resource objects are "owned" by a group. Those that are, are linked together through a different db table (`resource_ownership`). This commit removes the `Group` object from `Resource` objects and updates the `resource_ownership` where relevant.
Diffstat (limited to 'gn_auth/auth/authorisation/resources/genotype_resource.py')
-rw-r--r--gn_auth/auth/authorisation/resources/genotype_resource.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/gn_auth/auth/authorisation/resources/genotype_resource.py b/gn_auth/auth/authorisation/resources/genotype_resource.py
index 03e2e68..206ab61 100644
--- a/gn_auth/auth/authorisation/resources/genotype_resource.py
+++ b/gn_auth/auth/authorisation/resources/genotype_resource.py
@@ -32,13 +32,12 @@ def link_data_to_resource(
"""Link Genotype data with a resource."""
with db.cursor(conn) as cursor:
params = {
- "group_id": str(resource.group.group_id),
"resource_id": str(resource.resource_id),
"data_link_id": str(data_link_id)
}
cursor.execute(
"INSERT INTO genotype_resources VALUES"
- "(:group_id, :resource_id, :data_link_id)",
+ "(:resource_id, :data_link_id)",
params)
return params