Commit d7b008d3 authored by Ryan Goggin's avatar Ryan Goggin

Check to make sure that groups were actually provided before trying to sync

parent f7dae86f
......@@ -12,8 +12,9 @@ class Saml2Backend(djsaml2Backend):
for saml_attr, django_attrs in attribute_mapping.items():
if 'groups' in django_attrs:
group_list = attributes.get(saml_attr)
sync_user_groups(user, group_list)
del attribute_mapping[saml_attr]
if group_list is not None:
sync_user_groups(user, group_list)
del attribute_mapping[saml_attr]
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