Opened 2 years ago

Closed 2 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

Description

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 = 'mydomain.com' 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 2 years ago by claudep

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

Sure, this would be a good improvement.

comment:2 Changed 2 years ago by javimansilla

Submitted pull request https://github.com/django/django/pull/853 doing the needed changes.

comment:3 Changed 2 years ago by ramiro

  • Has patch set

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

  • Resolution set to fixed
  • Status changed from new to closed

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