From 4a3e6a5e3500308a428a6c7644f50d423adca6fc Mon Sep 17 00:00:00 2001 From: Jona Zantz <20zantz@cloak.mafiasi.de> Date: Sat, 23 Nov 2024 19:32:43 +0100 Subject: [PATCH] Map displayname to use custom Nicknames --- bitpoll/base/openid.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bitpoll/base/openid.py b/bitpoll/base/openid.py index a068976..e5502e8 100644 --- a/bitpoll/base/openid.py +++ b/bitpoll/base/openid.py @@ -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]