Prevent the logout view to put message (behaviour inherited from django-allauth)

fixes #5734
This commit is contained in:
Benjamin Dauvergne 2014-12-18 17:14:07 +01:00
parent a7bb0c4f47
commit 5a765e9b23
1 changed files with 7 additions and 0 deletions

View File

@ -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):