Opened 12 years ago

Last modified 8 days ago

#20372 assigned Cleanup/optimization

using registration/logged_out.html template overrides admin logout

Reported by: tomerz@… Owned by: Ayush Khatri
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 12 years ago.
use another template for logout in admin interface

Download all attachments as: .zip

Change History (21)

comment:1 by wim@…, 12 years ago

Easy pickings: set
Triage Stage: UnreviewedAccepted

I agree with you that this behaviour is inconsistent.

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

by Roman Gladkov, 12 years ago

Attachment: ticket_20372.diff added

use another template for logout in admin interface

comment:2 by Roman Gladkov, 12 years ago

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 by Tim Graham, 11 years ago

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

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

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 by Kamu, 11 years ago

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 by Susan Tan, 11 years ago

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

comment:7 by Alexis Bellido, 11 years ago

Owner: changed from nobody to Alexis Bellido
Status: newassigned

comment:8 by Florian Apolloner, 11 years ago

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 by Alexis Bellido, 11 years ago

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 by Tim Graham, 11 years ago

Easy pickings: unset
Type: BugCleanup/optimization

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

comment:11 by Ryan C. Schwiebert, 9 years ago

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 by Ryan C. Schwiebert, 9 years ago

Cc: ryan.c.schwiebert@… added

comment:13 by Bryan Marty, 8 years ago

I encountered this bug while following the documentation as well.

comment:14 by Hamed Fathi, 5 years ago

Hello please look at this bug because it's important to solve this issue because we need admin templates and custom templates be separate and we can create different templates in registration folder.

Last edited 5 years ago by Hamed Fathi (previous) (diff)

comment:15 by Mariusz Felisiak, 5 years ago

Hamed, feel-free to prepare a patch.

in reply to:  15 comment:16 by Hamed Fathi, 5 years ago

Replying to felixxm:

Hamed, feel-free to prepare a patch.

Hello, well how can I do that? Can you please tell me where I should read about contributing guideline?
Thank you.

Version 0, edited 5 years ago by Hamed Fathi (next)

comment:18 by Hamed Fathi, 5 years ago

The problem is same structure of template and registration folder for admin and our own app. When we use auth admin view at default it will go to the admin template folder and registration folder and render that html file. Am I right? or it works in an other way?

comment:19 by Mariusz Felisiak, 20 months ago

Owner: Alexis Bellido removed
Status: assignednew

comment:20 by Ayush Khatri , 8 days ago

Owner: set to Ayush Khatri
Status: newassigned
Note: See TracTickets for help on using tickets.
Back to Top