Skip to content

Commit 9633166

Browse files
authored
[maintenance] Fix add_user_to_proj script error (#4101)
1 parent f6c7211 commit 9633166

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

maintenance/scripts/add_user_to_proj.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def main() -> None:
8383
print(f"Could not update role for {args.user}, the project owner", file=sys.stderr)
8484
sys.exit(1)
8585
# Update the role
86-
update_role = f'{{ $set: {{"role" : {args.role}}} }}'
86+
update_role = f'{{ $set: {{"role" : "{args.role}"}} }}'
8787
upd_result = combine.db_cmd(
8888
f"db.UserRolesCollection.findOneAndUpdate({select_role}, {update_role})"
8989
)
@@ -96,7 +96,7 @@ def main() -> None:
9696
# 4. The user is not in the project
9797
# a. create a document in the UserRolesCollection,
9898
# b. set the role field in the user role to the requested role.
99-
insert_doc = f'{{ "role" : {args.role}, "projectId" : "{proj_id}" }}'
99+
insert_doc = f'{{ "role" : "{args.role}", "projectId" : "{proj_id}" }}'
100100
insert_result = combine.db_cmd(f"db.UserRolesCollection.insertOne({insert_doc})")
101101
if insert_result is not None:
102102
# c. add the new role to the user's document in the UsersCollection

0 commit comments

Comments
 (0)