From 840be9bb10bd63d3d22d2d825339729b0b9f1eb6 Mon Sep 17 00:00:00 2001 From: deyk Date: Tue, 15 May 2012 16:27:56 -0700 Subject: [PATCH] Now tracking login success. --- cas_provider/signals.py | 2 +- cas_provider/views.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cas_provider/signals.py b/cas_provider/signals.py index 799fb4e..ad366fd 100644 --- a/cas_provider/signals.py +++ b/cas_provider/signals.py @@ -8,6 +8,6 @@ on_cas_collect_histories = dispatch.Signal(providing_args=["for_email"]) on_cas_login = dispatch.Signal(providing_args=["request"]) -on_cas_login_success = dispatch.Signal(providing_args=["user"]) +on_cas_login_success = dispatch.Signal(providing_args=["user", "service"]) cas_collect_custom_attributes = dispatch.Signal(providing_args=['user']) diff --git a/cas_provider/views.py b/cas_provider/views.py index 6632722..9ceeca4 100644 --- a/cas_provider/views.py +++ b/cas_provider/views.py @@ -123,6 +123,9 @@ def login(request, template_name='cas/login.html', # Try and pull the service off the session service = request.session.pop('service', service) + signals.on_cas_login_success.send(sender=login, request=request, + service=service, **kwargs) + if service is None: # Normal internal success redirection. logging.debug('Redirecting to %s', success_redirect) -- 2.20.1