aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-09-26 11:27:12 -0500
committerFrederick Muriuki Muriithi2024-09-26 11:27:12 -0500
commit446830c9b13d91f4dc04e7858e592ae2e5b8367d (patch)
treeac6f51a6875c23f0d700c384e5b291729da23e6c
parent1ff4d8ca6b8bedda7e9e5a304142aa43bf869d94 (diff)
downloadgn-auth-446830c9b13d91f4dc04e7858e592ae2e5b8367d.tar.gz
Fix import and update arguments to function.
-rw-r--r--scripts/assign_data_to_default_admin.py7
1 files changed, 4 insertions, 3 deletions
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)