From 58aaf13e759cf60f8eaab42f650921923fde6502 Mon Sep 17 00:00:00 2001 From: hui shang Date: Thu, 24 Aug 2017 21:11:16 +0800 Subject: [1.11.x] Fixed #28513 -- Added POST request support to LogoutView. Backport of c0f4c60edd429f5ef57241cfabd159d13e26e5ac from master --- django/contrib/auth/views.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'django') diff --git a/django/contrib/auth/views.py b/django/contrib/auth/views.py index 4c51281436..f8934e9edb 100644 --- a/django/contrib/auth/views.py +++ b/django/contrib/auth/views.py @@ -159,6 +159,10 @@ class LogoutView(SuccessURLAllowedHostsMixin, TemplateView): return HttpResponseRedirect(next_page) return super(LogoutView, self).dispatch(request, *args, **kwargs) + def post(self, request, *args, **kwargs): + """Logout may be done via POST.""" + return self.get(request, *args, **kwargs) + def get_next_page(self): if self.next_page is not None: next_page = resolve_url(self.next_page) -- cgit v1.3