Ticket #9211: admin_escape_popup_newlines.diff

File admin_escape_popup_newlines.diff, 811 bytes (added by jbronn, 16 years ago)
  • django/contrib/admin/options.py

     
    426426        if request.POST.has_key("_popup"):
    427427            return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s");</script>' % \
    428428                # escape() calls force_unicode.
    429                 (escape(pk_value), escape(obj)))
     429                (escape(pk_value), escape(obj).replace(u'\r\n', ur'\r\n')))
    430430        elif request.POST.has_key("_addanother"):
    431431            self.message_user(request, msg + ' ' + (_("You may add another %s below.") % force_unicode(opts.verbose_name)))
    432432            return HttpResponseRedirect(request.path)
Back to Top