Commit ed6f861d authored by Ryan Goggin's avatar Ryan Goggin

Remove after iterating

parent d7b008d3
......@@ -9,12 +9,17 @@ class Saml2Backend(djsaml2Backend):
if not attribute_mapping:
return user
to_remove = []
for saml_attr, django_attrs in attribute_mapping.items():
if 'groups' in django_attrs:
group_list = attributes.get(saml_attr)
if group_list is not None:
sync_user_groups(user, group_list)
del attribute_mapping[saml_attr]
to_remove.append(saml_attr)
for remove in to_remove:
del attribute_mapping[remove]
return super(Saml2Backend, self).update_user(user, attributes, attribute_mapping, force_save)
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