Ticket #2986: remove_newlines.diff
File remove_newlines.diff, 1.3 KB (added by , 15 years ago) |
---|
-
django/contrib/admin/options.py
18 18 from django.utils.html import escape 19 19 from django.utils.safestring import mark_safe 20 20 from django.utils.functional import curry 21 from django.utils.text import capfirst, get_text_list 21 from django.utils.text import capfirst, get_text_list, normalize_newlines 22 22 from django.utils.translation import ugettext as _ 23 23 from django.utils.translation import ungettext, ugettext_lazy 24 24 from django.utils.encoding import force_unicode … … 644 644 if request.POST.has_key("_popup"): 645 645 return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s");</script>' % \ 646 646 # escape() calls force_unicode. 647 (escape(pk_value), escape(obj))) 647 # fixes #2986 by just removing newlines forcing everything into one long string. 648 (escape(pk_value), normalize_newlines(escape(obj)).replace('\n', ' '))) 648 649 elif request.POST.has_key("_addanother"): 649 650 self.message_user(request, msg + ' ' + (_("You may add another %s below.") % force_unicode(opts.verbose_name))) 650 651 return HttpResponseRedirect(request.path)