Ticket #2986: javascript.patch

File javascript.patch, 950 bytes (added by Thomas Steinacher <tom@…>, 18 years ago)

Patch

  • django/contrib/admin/views/main.py

     
    266266                if type(pk_value) is str: # Quote if string, so JavaScript doesn't think it's a variable.
    267267                    pk_value = '"%s"' % pk_value.replace('"', '\\"')
    268268                return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, %s, "%s");</script>' % \
    269                     (pk_value, str(new_object).replace('"', '\\"')))
     269                    (pk_value, str(new_object).replace('"', '\\"').replace('\n', ' ')))
    270270            elif request.POST.has_key("_addanother"):
    271271                request.user.message_set.create(message=msg + ' ' + (_("You may add another %s below.") % opts.verbose_name))
    272272                return HttpResponseRedirect(request.path)
Back to Top