#10759 closed (duplicate)
UserAdmin views should use attribute or current model to lookup the template paths
Reported by: | james Turnbull | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Keywords: | UserAdmin, add_view, user_change_password | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When overriding the add_view() and user_change_password() in UserAdmin I expected it to use the current model names to find the templates (like the rest of admin).
However, it was hardcoded to use admin/auth/user/add_form.html and admin/auth/user/change_password.html.
Attached patch adds in the path for the current model, falling back to the above for backwards compatibility.
Attachments (2)
Change History (14)
by , 16 years ago
Attachment: | admin_user_templates.diff added |
---|
comment:1 by , 16 years ago
milestone: | → 1.2 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 16 years ago
comment:3 by , 16 years ago
That's a bug, this is, in my view, a feature, admittingly a totally low overhead, noncontroversial no work one, but where that bar lies is for a committer to decide, so I've been intentionally rather conservative here.
comment:5 by , 16 years ago
Summary: | UserAdmin views should use the current model to lookup the template paths → UserAdmin views should use attribure or current model to lookup the template paths |
---|---|
Triage Stage: | Accepted → Unreviewed |
After thinking about this further, I've submitted a new patch and knocked this bug back to "Unreviewed". Apologies for messing it around.
Taking cues from ModelAdmin, this version first looks for local attributes add_form_template and change_password_template before then attempting the template based off the models name, and finally falling back to the auth.user template (for backwards compatiblity).
Also to follow the convention of ModelAdmin in this version I define a variable for the context and pass that into render_to_response rather than defining a variable for the templates as I did in the previous patch.
comment:6 by , 16 years ago
Summary: | UserAdmin views should use attribure or current model to lookup the template paths → UserAdmin views should use attribute or current model to lookup the template paths |
---|
Fixed a typo in the Summary.
comment:7 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:8 by , 15 years ago
milestone: | 1.2 |
---|
1.2 is feature-frozen, moving this feature request off the milestone.
comment:9 by , 15 years ago
milestone: | → 1.3 |
---|
This patch is ready to go and accepted - can someone push this into Django 1.3?
comment:10 by , 14 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
This was mostly fixed in #12218, so closing as a dupe.
Any chance this could get set for 1.1 rather than 1.2?
I only ask as it goes very well with my other (set for 1.1) patch here: #10694