Skip to content

Commit

Permalink
Merge pull request #158 from fsinfuhh/bigfix/loginWithoutGroup
Browse files Browse the repository at this point in the history
Fix login when user has no groups
  • Loading branch information
MarkusNeblung authored Jan 16, 2024
2 parents 1b1c4f1 + 02b6e51 commit 226e64e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bitpoll/base/openid.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def handle_federated_userinfo(self, user_data):

def automap_user_attrs(self, user, user_data):
super().automap_user_attrs(user, user_data)
for group_name in user_data.groups:
groups = getattr(user_data, "groups", [])
for group_name in groups:
group = Group.objects.get_or_create(name=group_name)[0]
group.user_set.add(user)
group.save()
Expand Down

0 comments on commit 226e64e

Please sign in to comment.