From: deyk Date: Mon, 16 Apr 2012 18:53:46 +0000 (-0700) Subject: OK, why isn't that working? X-Git-Tag: 22.4~24 X-Git-Url: https://git.mdrn.pl/django-cas-provider.git/commitdiff_plain/743e480255ba992e40e4723644f1721b1e2928fe?ds=sidebyside;hp=8c6445fb4e57c6ca7f09c8d45b06abf30e775817 OK, why isn't that working? --- diff --git a/cas_provider/__init__.py b/cas_provider/__init__.py index d5a3520..1dd6c7a 100644 --- a/cas_provider/__init__.py +++ b/cas_provider/__init__.py @@ -4,7 +4,6 @@ __all__ = [] _DEFAULTS = { 'CAS_TICKET_EXPIRATION': 5, # In minutes - 'CAS_CUSTOM_ATTRIBUTES_CALLBACK': None, 'CAS_CUSTOM_ATTRIBUTES_FORMATER': 'cas_provider.attribute_formatters.jasig', 'CAS_AUTO_REDIRECT_AFTER_LOGOUT': False, } diff --git a/cas_provider/attribute_formatters.py b/cas_provider/attribute_formatters.py index 3f3ab3c..a04828d 100644 --- a/cas_provider/attribute_formatters.py +++ b/cas_provider/attribute_formatters.py @@ -31,6 +31,7 @@ def ruby_cas(auth_success, attrs): element = etree.SubElement(auth_success, CAS + name) element.text = value + def name_value(auth_success, attrs): etree.SubElement(auth_success, CAS + 'attribute', name=u'attraStyle', value=u'Name-Value') for name, value in attrs.items(): diff --git a/cas_provider/views.py b/cas_provider/views.py index af36955..715d0ce 100644 --- a/cas_provider/views.py +++ b/cas_provider/views.py @@ -339,6 +339,7 @@ def auth_success_response(user, pgt, proxies): attrs = {} for receiver, response in signals.cas_collect_custom_attributes.send(sender=auth_success_response, user=user): if response: + print "Got custom attributes:", response attrs.update(response) if attrs: