From db65c3c50f425265fd06b06bc179120d99c2526e Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sat, 16 May 2015 23:54:40 +0200 Subject: [PATCH] Warning message on service authentication --- cas_server/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cas_server/views.py b/cas_server/views.py index 2f834e4..65b397c 100644 --- a/cas_server/views.py +++ b/cas_server/views.py @@ -88,6 +88,10 @@ def login(request): if gateway: list(messages.get_messages(request)) # clean messages before leaving the django app return redirect(service) + if request.session.get("authenticated") and renew: + messages.add_message(request, messages.WARNING, u"Demande de réautentification par le service %s." % service) + else: + messages.add_message(request, messages.WARNING, u"Demande d'autentification par le service %s." % service) return render(request, settings.CAS_LOGIN_TEMPLATE, {'form':form}) def logout(request):