From: deyk Date: Mon, 16 Apr 2012 23:48:37 +0000 (-0700) Subject: Added identifier history support to CAS 2.0 validation. `signals.on_cas_collect_histo... X-Git-Tag: 22.4~22 X-Git-Url: https://git.mdrn.pl/django-cas-provider.git/commitdiff_plain/73d0d205328a0c7df22bae99b3733660fbdbb842?ds=sidebyside;hp=a3d45d3e4477929c7daee0ed3a95ce6b5d6ae00b Added identifier history support to CAS 2.0 validation. `signals.on_cas_collect_histories` now keys off the user, not the email. --- diff --git a/cas_provider/views.py b/cas_provider/views.py index 68e6784..be6c4d4 100644 --- a/cas_provider/views.py +++ b/cas_provider/views.py @@ -169,7 +169,7 @@ def validate(request): username = ticket.user.username ticket.delete() - results = signals.on_cas_collect_histories.send(sender=validate, for_email=ticket.user.email) + results = signals.on_cas_collect_histories.send(sender=validate, for_user=ticket.user) histories = '\n'.join('\n'.join(rs) for rc, rs in results) logger.info('Validated %s %s', username, "(also %s)" % histories if histories else '') return HttpResponse("yes\n%s\n%s" % (username, histories)) @@ -341,6 +341,8 @@ def auth_success_response(user, pgt, proxies): if custom: attrs.update(custom) + attrs['identifiers'] = [i for r, i in signals.on_cas_collect_histories.send(sender=validate, for_user=user)] + if attrs: formatter = get_callable(settings.CAS_CUSTOM_ATTRIBUTES_FORMATER) formatter(auth_success, attrs)