Opened 5 years ago

Closed 5 years ago

#19773 closed Cleanup/optimization (fixed)

Moving the response after a popup submission to a template so that it can be overwritten.

Reported by: jimmylam@… Owned by: nobody
Component: contrib.admin Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Currently, after a popup submission (e.g. adding another User thur the "+" link in django admin), the response is

'<!DOCTYPE html><html><head><title></title></head><body>'
'<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s");</script></body></html>' % \

# escape() calls force_unicode.
(escape(pk_value), escapejs(obj)))

Can this be changed so that it is loaded from a template file? And so, the template file can then be overwritten.

Since most browsers are having more strict cross-site pop-up windows security checking and my site are being loaded from different subdomains. In order to make them work together, i have to add the javascript
'document.domain = '' in the templates, including the admin templates.

However, the above response can't be modified or overwritten because it's part of the code within the response_add method of ModelAdmin.

Change History (4)

comment:1 Changed 5 years ago by Claude Paroz

Triage Stage: UnreviewedAccepted

Sure, this would be a good improvement.

comment:2 Changed 5 years ago by javimansilla

Submitted pull request doing the needed changes.

comment:3 Changed 5 years ago by Ramiro Morales

Has patch: set

comment:4 Changed 5 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In f819bef3dc935851f71e4ad84592eee8664a48f3:

Fixed #19773 - Added admin/popup_response.html template.

Thanks jimmylam@ for the suggestion.

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