Ticket #6307: js.diff

File js.diff, 986 bytes (added by Jonas <django@…>, 17 years ago)

Patch for django/contrib/admin/options.py

  • django/contrib/admin/options.py

     
    384384            return HttpResponseRedirect(post_url_continue % pk_value)
    385385        if request.POST.has_key("_popup"):
    386386            if type(pk_value) is str: # Quote if string, so JavaScript doesn't think it's a variable.
    387                 pk_value = '"%s"' % pk_value.replace('"', '\\"')
    388             return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, %s, "%s");</script>' % \
     387                pk_value = pk_value.replace('"', '\\"')
     388            return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s");</script>' % \
    389389                # escape() calls force_unicode.
    390390                (escape(pk_value), escape(new_object)))
    391391        elif request.POST.has_key("_addanother"):
Back to Top