From 5a765e9b23965d06d82c8e24083de177707f26bc Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 18 Dec 2014 17:14:07 +0100 Subject: [PATCH] Prevent the logout view to put message (behaviour inherited from django-allauth) fixes #5734 --- portail_citoyen2/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/portail_citoyen2/views.py b/portail_citoyen2/views.py index 8267522..a674989 100644 --- a/portail_citoyen2/views.py +++ b/portail_citoyen2/views.py @@ -6,6 +6,8 @@ from django.http import HttpResponse from django.utils.timezone import now from django.contrib.auth import get_user_model +from django.contrib.auth import logout as auth_logout + from allauth.account.views import LogoutView from allauth.account.adapter import get_adapter @@ -14,6 +16,11 @@ class PCLogoutView(LogoutView): return (self.request.REQUEST.get(self.redirect_field_name) or get_adapter().get_logout_redirect_url(self.request)) + def logout(self): + # override django-allauth behaviour to prevent it to put a + # message(using django.contrib.messages) + auth_logout(self.request) + logout = PCLogoutView.as_view() def stats(request):