summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--portail_citoyen2/views.py7
1 files changed, 7 insertions, 0 deletions
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):