Commit 4fa25981 authored by Lukas Burgey's avatar Lukas Burgey

Fix a bug in the userinfo updating

parent 4780bd9b
......@@ -268,23 +268,24 @@ class User(AbstractUser):
LOGGER.info(self.msg('New: %s'), ent)
self.vos.add(ent)
self.user_changed_vo_added(loc_ent)
self.user_changed_vo_added(ent)
def update_userinfo_groups(self, userinfo):
if self.idp.userinfo_field_groups is None:
return
groups = userinfo.get(self.idp.userinfo_field_groups, [])
local_groups = self.vos.instance_of(Group)
remote_groups = userinfo.get(self.idp.userinfo_field_groups, [])
# check if groups were removed
for group in self.vos.instance_of(Group):
if group.name not in groups:
for group in local_groups:
if group.name not in remote_groups:
self.vos.remove(group)
self.user_changed_vo_removed(group)
# check if groups were added
for group_name in groups:
for group_name in remote_groups:
group = Group.get_group(name=group_name, idp=self.idp)
# check if user needs to be in this group
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment