diff options
| author | Edward Tjörnhammar <e@cube2.se> | 2012-11-25 23:13:22 +0100 |
|---|---|---|
| committer | Julien Phalip <jphalip@gmail.com> | 2012-11-25 23:13:30 +0100 |
| commit | 29d59a879ea5b116cc31a2fd91be1f7562e487c2 (patch) | |
| tree | f0c382eb697758ede86320fff04391d000953a20 /django | |
| parent | 05dbc07c52ec222f57d358f13f9192ab2b20d098 (diff) | |
Fixed #17911 -- Ensure that admin readonly fields' display values are shown in change forms when the raw value is None.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/admin/helpers.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py index 90370bd978..4203287123 100644 --- a/django/contrib/admin/helpers.py +++ b/django/contrib/admin/helpers.py @@ -186,9 +186,7 @@ class AdminReadonlyField(object): if getattr(attr, "allow_tags", False): result_repr = mark_safe(result_repr) else: - if value is None: - result_repr = EMPTY_CHANGELIST_VALUE - elif isinstance(f.rel, ManyToManyRel): + if isinstance(f.rel, ManyToManyRel) and value is not None: result_repr = ", ".join(map(six.text_type, value.all())) else: result_repr = display_for_field(value, f) |
