X-Git-Url: https://git.mdrn.pl/django-cas-provider.git/blobdiff_plain/0b76f6154ffb5fabd7c0cd22ff3f2720cedeb48f..8ace0586471d741bbe1d55dca48f524a3d385852:/cas_provider/views.py?ds=inline diff --git a/cas_provider/views.py b/cas_provider/views.py index fdae99f..5ba62e6 100644 --- a/cas_provider/views.py +++ b/cas_provider/views.py @@ -26,7 +26,8 @@ def _build_service_url(service, ticket): return service + '&ticket=' + ticket -def login(request, template_name='cas/login.html', success_redirect='/account/', merge=False): +def login(request, template_name='cas/login.html', success_redirect='/account/', **kwargs): + merge = kwargs.get('merge', False) logging.debug('CAS Provider Login view. Method is %s, merge is %s, template is %s.', request.method, merge, template_name) @@ -93,6 +94,11 @@ def login(request, template_name='cas/login.html', success_redirect='/account/', if not user.is_active: errors.append('This account is disabled.') else: + # Send the on_cas_login signal. If we get an HttpResponse, return that. + for receiver, response in signals.on_cas_login.send(sender=login, request=request, **kwargs): + if isinstance(response, HttpResponse): + return response + if service is None: # Try and pull the service off the session service = request.session.pop('service', service)