Ticket #5704: 5704-r17038.diff

File 5704-r17038.diff, 1.8 KB (added by claudep, 3 years ago)

Updated patch after media -> static renaming

  • django/contrib/admin/options.py

    diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
    index 91b81a4..3a0ad74 100644
    a b class ModelAdmin(BaseModelAdmin): 
    779779            return HttpResponseRedirect(post_url_continue % pk_value)
    780780
    781781        if "_popup" in request.POST:
    782             return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s");</script>' % \
     782            return HttpResponse(
     783                '<!DOCTYPE html><html><head><title></title></head><body>'
     784                '<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s");</script></body></html>' % \
    783785                # escape() calls force_unicode.
    784786                (escape(pk_value), escapejs(obj)))
    785787        elif "_addanother" in request.POST:
  • django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js

    diff --git a/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js b/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js
    index 1bc78f8..ce54fa5 100644
    a b function dismissAddAnotherPopup(win, newId, newRepr) { 
    7474    var name = windowname_to_id(win.name);
    7575    var elem = document.getElementById(name);
    7676    if (elem) {
    77         if (elem.nodeName == 'SELECT') {
     77        var elemName = elem.nodeName.toUpperCase();
     78        if (elemName == 'SELECT') {
    7879            var o = new Option(newRepr, newId);
    7980            elem.options[elem.options.length] = o;
    8081            o.selected = true;
    81         } else if (elem.nodeName == 'INPUT') {
     82        } else if (elemName == 'INPUT') {
    8283            if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) {
    8384                elem.value += ',' + newId;
    8485            } else {
Back to Top