diff --git a/django/contrib/admin/templates/admin/edit_inline/tabular.html b/django/contrib/admin/templates/admin/edit_inline/tabular.html index f2757ede48..71a62ba71a 100644 --- a/django/contrib/admin/templates/admin/edit_inline/tabular.html +++ b/django/contrib/admin/templates/admin/edit_inline/tabular.html @@ -46,7 +46,7 @@ {% for field in line %}
{{ field.contents }}
+{{ field.contents|linebreaksbr }}
{% else %} {{ field.field.errors.as_ul }} {{ field.field }} diff --git a/tests/regressiontests/admin_views/admin.py b/tests/regressiontests/admin_views/admin.py index d71c398376..1e4e9b5c75 100644 --- a/tests/regressiontests/admin_views/admin.py +++ b/tests/regressiontests/admin_views/admin.py @@ -346,7 +346,10 @@ class LinkInline(admin.TabularInline): model = Link extra = 1 - readonly_fields = ("posted",) + readonly_fields = ("posted", "multiline") + + def multiline(self, instance): + return "InlineMultiline\ntest\nstring" class SubPostInline(admin.TabularInline): diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py index bbb8281fed..10f946132d 100644 --- a/tests/regressiontests/admin_views/tests.py +++ b/tests/regressiontests/admin_views/tests.py @@ -3164,6 +3164,7 @@ class ReadonlyTest(TestCase): # Checks that multiline text in a readonly field gets