Skip to content

Commit

Permalink
Fix login when user has no groups
Browse files Browse the repository at this point in the history
  • Loading branch information
timonegk committed Jan 15, 2024
1 parent 45a272a commit bff8936
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mafiasi/registration/user_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ def update_user_from_token(user: MafiasiUser, id_token: IdToken) -> None:
user.last_name = id_token.family_name

if settings.OPENID_SYNC_SUPERUSER:
user.is_superuser = settings.OPENID_SUPERUSER_GROUP in id_token.groups
groups = getattr(id_token, "groups", [])
user.is_superuser = settings.OPENID_SUPERUSER_GROUP in groups

0 comments on commit bff8936

Please sign in to comment.