summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorhui shang <shangdahao@gmail.com>2017-08-24 21:11:16 +0800
committerTim Graham <timograham@gmail.com>2017-08-24 09:11:34 -0400
commit58aaf13e759cf60f8eaab42f650921923fde6502 (patch)
treea343e491a118c9c28f17419e0d3cff95461fbcef /django
parent0d21bdd3805f5d3a37a02062a170cabe377aa8fe (diff)
[1.11.x] Fixed #28513 -- Added POST request support to LogoutView.
Backport of c0f4c60edd429f5ef57241cfabd159d13e26e5ac from master
Diffstat (limited to 'django')
-rw-r--r--django/contrib/auth/views.py4
1 files changed, 4 insertions, 0 deletions
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)