[Django] #27313: Admin: Popup Response Template Needs to Be Overridable on an App or Model Basis

32 views
Skip to first unread message

Django

unread,
Oct 4, 2016, 10:40:30 AM10/4/16
to django-...@googlegroups.com
#27313: Admin: Popup Response Template Needs to Be Overridable on an App or Model
Basis
-------------------------------+-----------------------------------
Reporter: Ustun Ozgur | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.10
Severity: Normal | Keywords: admin popup templates
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+-----------------------------------
In admin, popup response template ( admin/popup_response.html ) is project
global, unlike change_form or change_list which can be overridden on an
app or model basis.

Compare:

https://github.com/django/django/blob/12b9aa279f453f0a41c1153393b6211d8352302c/django/contrib/admin/options.py#L1105

to

https://github.com/django/django/blob/master/django/contrib/admin/options.py#L1064-L1067

Seems like an easy change and I would like to submit a patch in case there
is a particular reason (security?) this is not customizable.

popup_response.html was originally added by this ticket:
https://code.djangoproject.com/ticket/19773

--
Ticket URL: <https://code.djangoproject.com/ticket/27313>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 4, 2016, 10:54:17 AM10/4/16
to django-...@googlegroups.com
#27313: Admin: Popup Response Template Needs to Be Overridable on an App or Model
Basis
-------------------------------------+-------------------------------------

Reporter: Ustun Ozgur | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.admin | Version: 1.10
Severity: Normal | Resolution:
Keywords: admin popup | Triage Stage:
templates | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_better_patch: => 0
* type: Bug => Cleanup/optimization
* needs_tests: => 0
* needs_docs: => 0


Comment:

Probably the use case was never considered. Could you give one?

--
Ticket URL: <https://code.djangoproject.com/ticket/27313#comment:1>

Django

unread,
Oct 4, 2016, 11:19:03 AM10/4/16
to django-...@googlegroups.com
#27313: Admin: Popup Response Template Needs to Be Overridable on an App or Model
Basis
-------------------------------------+-------------------------------------

Reporter: Ustun Ozgur | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.admin | Version: 1.10

Severity: Normal | Resolution:
Keywords: admin popup | Triage Stage:
templates | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Ustun Ozgur):

In my particular case, I'm using django-selectable library. It provides
autocomplete, but lacks it for M2M fields. So, I need some custom JS which
basically needs some more data for a particular model so that I can inject
it into the opener page.

--
Ticket URL: <https://code.djangoproject.com/ticket/27313#comment:2>

Django

unread,
Oct 4, 2016, 1:08:49 PM10/4/16
to django-...@googlegroups.com
#27313: Allow overriding the admin's popup response template on an app or model
basis
-------------------------------------+-------------------------------------

Reporter: Ustun Ozgur | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.admin | Version: 1.10
Severity: Normal | Resolution:
Keywords: admin popup | Triage Stage: Accepted
templates |

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/27313#comment:3>

Django

unread,
Oct 13, 2016, 4:28:54 PM10/13/16
to django-...@googlegroups.com
#27313: Allow overriding the admin's popup response template on an app or model
basis
-------------------------------------+-------------------------------------
Reporter: Ustun Ozgur | Owner: Michael
Type: | Scott
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 1.10

Severity: Normal | Resolution:
Keywords: admin popup | Triage Stage: Accepted
templates |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Michael Scott):

* status: new => assigned
* owner: nobody => Michael Scott


Comment:

I'll pick this up and see if I can make the suggested change.

--
Ticket URL: <https://code.djangoproject.com/ticket/27313#comment:4>

Django

unread,
Nov 12, 2016, 2:12:56 PM11/12/16
to django-...@googlegroups.com
#27313: Allow overriding the admin's popup response template on an app or model
basis
-------------------------------------+-------------------------------------
Reporter: Ustun Ozgur | Owner: Michael
Type: | Scott
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 1.10

Severity: Normal | Resolution:
Keywords: admin popup | Triage Stage: Accepted
templates |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Michael Scott):

* has_patch: 0 => 1


Comment:

Sorry its taken a while but I've finally created a PR to make the proposed
changes. Please let me know if there are any issues with the changes or
potential improvements.

https://github.com/django/django/pull/7548

--
Ticket URL: <https://code.djangoproject.com/ticket/27313#comment:5>

Django

unread,
Dec 14, 2016, 6:11:31 PM12/14/16
to django-...@googlegroups.com
#27313: Allow overriding the admin's popup response template on an app or model
basis
-------------------------------------+-------------------------------------
Reporter: Ustun Ozgur | Owner: Michael
Type: | Scott
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 1.10
Severity: Normal | Resolution: fixed

Keywords: admin popup | Triage Stage: Accepted
templates |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"1e629928e9257da5ec37a65784c0f68889d3edf4" 1e629928]:
{{{
#!CommitTicketReference repository=""
revision="1e629928e9257da5ec37a65784c0f68889d3edf4"
Fixed #27313 -- Allowed overriding admin popup response template.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27313#comment:6>

Reply all
Reply to author
Forward
0 new messages