Skip to content

Commit

Permalink
signup handler: fix missing indexing of groups
Browse files Browse the repository at this point in the history
  • Loading branch information
jrcastro2 committed May 10, 2023
1 parent 3c55612 commit aeea751
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions invenio_oauthclient/handlers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
token_session_key,
token_setter,
)
from invenio_accounts.proxies import current_datastore


#
Expand Down Expand Up @@ -110,12 +111,7 @@ def base_authorized_signup_handler(resp, remote, *args, **kwargs):

provides = set(UserNeed(account_info["user"]["email"]))
for group in account_groups:
role = Role(
id=group["id"], name=group["name"], description=group["description"]
)
db.session.merge(
role
) # Creates a new role if it doesn't exist, else update it (change FK value for example)
role = current_datastore.create_role(id=group["id"], name=group["name"], description=group["description"])
provides.add(RoleNeed(role.id))
g.identity.provides |= provides

Expand Down

0 comments on commit aeea751

Please sign in to comment.