aboutsummaryrefslogtreecommitdiff
path: root/scripts/assign_data_to_default_admin.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/assign_data_to_default_admin.py')
-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)