From 446830c9b13d91f4dc04e7858e592ae2e5b8367d Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 26 Sep 2024 11:27:12 -0500 Subject: Fix import and update arguments to function. --- scripts/assign_data_to_default_admin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/assign_data_to_default_admin.py b/scripts/assign_data_to_default_admin.py index 0ae209a..d10b687 100644 --- a/scripts/assign_data_to_default_admin.py +++ b/scripts/assign_data_to_default_admin.py @@ -22,8 +22,8 @@ from gn_auth.auth.authorisation.roles.models import ( from gn_auth.auth.authorisation.resources.groups.models import ( Group, save_group, add_resources_to_group) -from gn_auth.auth.authorisation.resources.models import ( - Resource, ResourceCategory, __assign_resource_owner_role__) +from gn_auth.auth.authorisation.resources.common import assign_resource_owner_role +from gn_auth.auth.authorisation.resources.models import Resource, ResourceCategory class DataNotFound(Exception): @@ -412,7 +412,8 @@ def entry(authdbpath, mysqldburi): assign_data_to_resource( authconn, bioconn, resource, the_admin_group) with authdb.cursor(authconn) as cursor: - __assign_resource_owner_role__(cursor, resource, admin) + assign_resource_owner_role( + cursor, resource.resource_id, admin.user_id) except DataNotFound as dnf: print(dnf.args[0], file=sys.stderr) sys.exit(1) -- cgit v1.2.3