[Django] #28513: django 1.11 doesn't support POST for logout view

14 views
Skip to first unread message

Django

unread,
Aug 21, 2017, 7:10:08 AM8/21/17
to django-...@googlegroups.com
#28513: django 1.11 doesn't support POST for logout view
-----------------------------------------+------------------------
Reporter: Paulo | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
Hello,

On Django versions < 1.11, the logout view allowed us to use a POST
request.

Because no ''post'' method is defined on the new ''LogoutView'' introduced
in
https://github.com/django/django/commit/78963495d0caadb77eb97ccf319ef0ba3b204fb5,
a POST request will raise 405 Method not allowed error. I don't think POST
was officially supported (don't see it in the docs) but there's code in
the view that checks for the redirect field in the POST data.

--
Ticket URL: <https://code.djangoproject.com/ticket/28513>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 21, 2017, 7:49:39 AM8/21/17
to django-...@googlegroups.com
#28513: LogoutView doesn't support POST, unlike the function-based logout() view
---------------------------------+------------------------------------
Reporter: Paulo | Owner: nobody
Type: Bug | Status: new
Component: contrib.auth | Version: 1.11
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by Tim Graham):

* component: Uncategorized => contrib.auth
* stage: Unreviewed => Accepted
* type: Uncategorized => Bug
* severity: Normal => Release blocker


Old description:

> Hello,
>
> On Django versions < 1.11, the logout view allowed us to use a POST
> request.
>
> Because no ''post'' method is defined on the new ''LogoutView''
> introduced in
> https://github.com/django/django/commit/78963495d0caadb77eb97ccf319ef0ba3b204fb5,
> a POST request will raise 405 Method not allowed error. I don't think
> POST was officially supported (don't see it in the docs) but there's code
> in the view that checks for the redirect field in the POST data.

New description:

The function-based `logout()` view allows using a POST request.

Because the new `LogoutView` introduced in
78963495d0caadb77eb97ccf319ef0ba3b204fb5 doesn't define a `post()` method,
a POST request returns "405 Method not allowed". I don't think POST was


officially supported (don't see it in the docs) but there's code in the
view that checks for the redirect field in the POST data.

--

Comment:

It seems reasonable to support that.

--
Ticket URL: <https://code.djangoproject.com/ticket/28513#comment:1>

Django

unread,
Aug 23, 2017, 2:49:50 AM8/23/17
to django-...@googlegroups.com
#28513: LogoutView doesn't support POST, unlike the function-based logout() view
---------------------------------+-------------------------------------
Reporter: Paulo | Owner: hui shang
Type: Bug | Status: assigned

Component: contrib.auth | Version: 1.11
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+-------------------------------------
Changes (by hui shang):

* owner: nobody => hui shang
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28513#comment:2>

Django

unread,
Aug 23, 2017, 10:04:23 AM8/23/17
to django-...@googlegroups.com
#28513: LogoutView doesn't support POST, unlike the function-based logout() view
---------------------------------+-------------------------------------
Reporter: Paulo | Owner: hui shang
Type: Bug | Status: assigned
Component: contrib.auth | Version: 1.11
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+-------------------------------------
Changes (by hui shang):

* has_patch: 0 => 1


Comment:

[ https://github.com/django/django/pull/8964#### PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/28513#comment:3>

Django

unread,
Aug 23, 2017, 3:29:30 PM8/23/17
to django-...@googlegroups.com
#28513: LogoutView doesn't support POST, unlike the function-based logout() view
-------------------------------------+-------------------------------------

Reporter: Paulo | Owner: hui shang
Type: Bug | Status: assigned
Component: contrib.auth | Version: 1.11
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/28513#comment:4>

Django

unread,
Aug 24, 2017, 9:11:43 AM8/24/17
to django-...@googlegroups.com
#28513: LogoutView doesn't support POST, unlike the function-based logout() view
-------------------------------------+-------------------------------------
Reporter: Paulo | Owner: hui shang
Type: Bug | Status: closed
Component: contrib.auth | Version: 1.11
Severity: Release blocker | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"c0f4c60edd429f5ef57241cfabd159d13e26e5ac" c0f4c60e]:
{{{
#!CommitTicketReference repository=""
revision="c0f4c60edd429f5ef57241cfabd159d13e26e5ac"
Fixed #28513 -- Added POST request support to LogoutView.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28513#comment:5>

Django

unread,
Aug 24, 2017, 9:18:38 AM8/24/17
to django-...@googlegroups.com
#28513: LogoutView doesn't support POST, unlike the function-based logout() view
-------------------------------------+-------------------------------------
Reporter: Paulo | Owner: hui shang
Type: Bug | Status: closed
Component: contrib.auth | Version: 1.11
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"58aaf13e759cf60f8eaab42f650921923fde6502" 58aaf13e]:
{{{
#!CommitTicketReference repository=""
revision="58aaf13e759cf60f8eaab42f650921923fde6502"
[1.11.x] Fixed #28513 -- Added POST request support to LogoutView.

Backport of c0f4c60edd429f5ef57241cfabd159d13e26e5ac from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28513#comment:6>

Reply all
Reply to author
Forward
0 new messages