From 743e480255ba992e40e4723644f1721b1e2928fe Mon Sep 17 00:00:00 2001 From: deyk Date: Mon, 16 Apr 2012 11:53:46 -0700 Subject: [PATCH] OK, why isn't that working? --- cas_provider/__init__.py | 1 - cas_provider/attribute_formatters.py | 1 + cas_provider/views.py | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) 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: -- 2.20.1