Skip to content

Commit

Permalink
Merge pull request #148 from fsinfuhh/fix/no_group_login
Browse files Browse the repository at this point in the history
Fix login when user has no groups
  • Loading branch information
timonegk authored Jan 15, 2024
2 parents 45a272a + bff8936 commit 42e05ef
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 42e05ef

Please sign in to comment.