Opened 9 months ago

Closed 9 months ago

#35150 closed Bug (invalid)

Logout no longer supports GET method

Reported by: Clutch_Reboot Owned by: nobody
Component: HTTP handling Version: 5.0
Severity: Normal Keywords: LogoutView GET
Cc: Clutch_Reboot Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Problem: Following documentation, I tried using the LogoutView to logout like I have in the past. Now that I'm using 5.0, it looks like things have changed. It does not allow GET method calls.

Either we need to allow GET calls again or tutorial documentation needs updated.

Documentation Code:

{% if user.is_authenticated %}
  Hi {{ user.username }}!
  <p><a href="{% url 'logout' %}" >Log Out</a></p>
{% else %}
  <p>You are not logged in</p>
  <a href="{% url 'login' %}">Log In</a>
{% endif %}

Code in question:
https://github.com/django/django/blob/2005530920e7c290bb1cf7d9ada155250faa81ad/django/contrib/auth/views.py#L129

Change History (3)

comment:1 by Simon Charette, 9 months ago

Unsure which documentation code tutorial you are referring to but the docs clearly mention how to upgrade.

What documentation are you referring to?

comment:2 by Clutch_Reboot, 9 months ago

Disregard. I was using outdated documentation.

comment:3 by Simon Charette, 9 months ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top