Opened 2 years ago

Last modified 23 months ago

#20372 assigned Cleanup/optimization

using registration/logged_out.html template overrides admin logout

Reported by: tomerz@… Owned by: alexisbellido
Component: contrib.admin Version: 1.5
Severity: Normal Keywords:
Cc: d1fffuz0r@… 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 d1ffuz0r 2 years ago.
use another template for logout in admin interface

Download all attachments as: .zip

Change History (11)

comment:1 Changed 2 years ago by wim@…

  • Easy pickings set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

I agree with you that this behaviour is inconsistent.

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

Changed 2 years ago by d1ffuz0r

use another template for logout in admin interface

comment:2 Changed 2 years ago by d1ffuz0r

  • 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 follow-up: Changed 2 years ago by timo

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

comment:4 in reply to: ↑ 3 Changed 2 years ago by ramiro

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 2 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 2 years ago by susan

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 23 months ago by alexisbellido

  • Owner changed from nobody to alexisbellido
  • Status changed from new to assigned

comment:8 Changed 23 months ago by apollo13

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 23 months ago by alexisbellido

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 23 months ago by timo

  • Easy pickings unset
  • Type changed from Bug to Cleanup/optimization

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

Note: See TracTickets for help on using tickets.
Back to Top