#25465 closed Bug (fixed)
Line breaks in readonly field in admin tabular inline
Reported by: | Patrick Craston | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 1.8 |
Severity: | Normal | Keywords: | tabular inline |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
If a model TextField is rendered as read-only inside a included fieldset or an admin.TabularInline section, line breaks are ignored.
This is because of the changes made in https://github.com/django/django/commit/c94bff2b26f8844fe15d68a79511ff3a6853dc61 :
to these files:
django/contrib/admin/templates/admin/edit_inline/tabular.html
django/contrib/admin/templates/admin/includes/fieldset.html
Specifically the following code change in both files:
{% if field.is_readonly %} - <p>{{ field.contents|linebreaksbr }}</p> + <p>{{ field.contents }}</p>
The linebreaksbr template tag was removed but the django/contrib/admin/helpers.py:186 linebreaksbr function is only applied to custom ModelAdmin methods but not plain admin fields
Am I missing something or is this a bug?
Change History (11)
comment:1 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 9 years ago
Issue relevant not only to 1.8 version.
Line breaks ignored in templates in master branch:
comment:4 by , 9 years ago
Needs tests: | set |
---|---|
Patch needs improvement: | set |
follow-up: 6 comment:5 by , 9 years ago
The ticket "Version" field is the version the ticket is reported in and generally doesn't need to be updated to "master" (if the issue is no longer relevant on master, then the ticket is can usually be closed). If this is a regression in 1.8, then it qualifies for a backport.
comment:6 by , 9 years ago
Replying to timgraham:
The ticket "Version" field is the version the ticket is reported in and generally doesn't need to be updated to "master" (if the issue is no longer relevant on master, then the ticket is can usually be closed).
Ok, thanks for the info, will consider in the future.
If this is a regression in 1.8, then it qualifies for a backport.
Yes, it's a regression, but appeared to be in 1.7 - it still worked in 1.6.11.
comment:7 by , 9 years ago
Needs tests: | unset |
---|---|
Patch needs improvement: | unset |
comment:8 by , 9 years ago
Triage Stage: | Accepted → Ready for checkin |
---|---|
Version: | master → 1.8 |
It seems this was probably an oversight.