- if settings.CAS_CUSTOM_ATTRIBUTES_CALLBACK:
- callback = get_callable(settings.CAS_CUSTOM_ATTRIBUTES_CALLBACK)
- attrs = callback(user)
- if len(attrs) > 0:
- formater = get_callable(settings.CAS_CUSTOM_ATTRIBUTES_FORMATER)
- formater(auth_success, attrs)
+ attrs = {}
+ for receiver, custom in signals.cas_collect_custom_attributes.send(sender=auth_success_response, user=user):
+ if custom:
+ attrs.update(custom)
+
+ identifiers = [i for sr, rr in signals.on_cas_collect_histories.send(sender=validate, for_user=user)
+ for i in rr]
+
+ if identifiers:
+ attrs['identifiers'] = identifiers
+
+ if attrs:
+ formatter = get_callable(settings.CAS_CUSTOM_ATTRIBUTES_FORMATER)
+ formatter(auth_success, attrs)