Opened 3 years ago

Last modified 7 months ago

#20372 assigned Cleanup/optimization

using registration/logged_out.html template overrides admin logout

Reported by: tomerz@… Owned by: Alexis Bellido
Component: contrib.admin Version: 1.5
Severity: Normal Keywords:
Cc: d1fffuz0r@…, ryan.c.schwiebert@… Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Hi

I created registration/login.html and registration/logged_out.html templates to handle my site login/logout using the provided auth views login/logout. While the admin app login using admin/login.html, it logouts using registration/logged_out.html. So, having my own registration/logged_out.html overrides that of the admin app.

Attachments (1)

ticket_20372.diff (2.2 KB) - added by Roman Gladkov 3 years ago.
use another template for logout in admin interface

Download all attachments as: .zip

Change History (13)

comment:1 Changed 3 years ago by wim@…

Easy pickings: set
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

I agree with you that this behaviour is inconsistent.

You are welcome to supply a patch, if you want to.

Changed 3 years ago by Roman Gladkov

Attachment: ticket_20372.diff added

use another template for logout in admin interface

comment:2 Changed 3 years ago by Roman Gladkov

Cc: d1fffuz0r@… added
Has patch: set
Needs documentation: set
Patch needs improvement: set

added patch, if it's right way, then I'll do documentation and translations

comment:3 Changed 3 years ago by Tim Graham

While this would make things more consistent, wouldn't it be backwards incompatible?

comment:4 in reply to:  3 Changed 3 years ago by Ramiro Morales

Replying to timo:

While this would make things more consistent, wouldn't it be backwards incompatible?

If the inconsistent behavior is new (e.g.introduced with 1.4 or 1.5) I'm happy to call it a bug and fix it right away just like any other bug. The sooner the better.

If the has more historical roots IMHO we can apply the same reasoning but I'm open to suggestions about how to handle the timeline.

comment:5 Changed 3 years ago by Kamu

The overriding of logout/login templates was added in 1.2 Alpha in response to ticket #8933.
https://github.com/django/django/commit/a2056919799e48f053fa16b65569fc1e8f57ebe1

comment:6 Changed 3 years ago by Susan Tan

I've just applied the given attached patch. I get an error: "TemplateDoesNotExist: admin/logged_out.html" How do i fix this?

comment:7 Changed 3 years ago by Alexis Bellido

Owner: changed from nobody to Alexis Bellido
Status: newassigned

comment:8 Changed 3 years ago by Florian Apolloner

Closing the PR for now since it is highly backwards incompatible; without some extra shim this will be hard to get in (at least needs comments in the releasenotes).

comment:9 Changed 3 years ago by Alexis Bellido

Thanks for the comment. Would you recommend me to spend some time writing that shim so that projects using the older templates locations continue to work?

comment:10 Changed 3 years ago by Tim Graham

Easy pickings: unset
Type: BugCleanup/optimization

@alexisbellido Yes, some form of backwards compatibility will be needed here.

comment:11 Changed 7 months ago by Ryan C. Schwiebert

I ran into this bug because it occurs in the course of following this documentation here: https://docs.djangoproject.com/en/1.9/topics/auth/default/#using-the-views

It's not very nice that the "happy path" outlined here in the docs runs into this bug. If the problem is going to continue to be unfixed, is there an inline warning that could go in the docs about the issue here?

comment:12 Changed 7 months ago by Ryan C. Schwiebert

Cc: ryan.c.schwiebert@… added
Note: See TracTickets for help on using tickets.
Back to Top