- if settings.CAS_CUSTOM_ATTRIBUTES_CALLBACK:
- callback = get_callable(settings.CAS_CUSTOM_ATTRIBUTES_CALLBACK)
- attrs = callback(user)
- if len(attrs) > 0:
- formatter = get_callable(settings.CAS_CUSTOM_ATTRIBUTES_FORMATER)
- formatter(auth_success, attrs)
+ attrs = {}
+ for receiver, response in signals.cas_collect_custom_attributes.send(user):
+ if response:
+ attrs.update(response)
+
+ if attrs:
+ formatter = get_callable(settings.CAS_CUSTOM_ATTRIBUTES_FORMATER)
+ formatter(auth_success, attrs)