Skip to content

Commit

Permalink
Map displayname to use custom Nicknames
Browse files Browse the repository at this point in the history
  • Loading branch information
Jona Zantz committed Nov 23, 2024
1 parent 100e61a commit 4a3e6a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bitpoll/base/openid.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def handle_federated_userinfo(self, user_data):

def automap_user_attrs(self, user, user_data):
super().automap_user_attrs(user, user_data)
if hasattr(user_data, "display_name"):
user.displayname = user_data.display_name
user.save()

groups = getattr(user_data, "groups", [])
for group_name in groups:
group = Group.objects.get_or_create(name=group_name)[0]
Expand Down

0 comments on commit 4a3e6a5

Please sign in to comment.