diff -r d40a8d6441fe lib/django/contrib/admin/templatetags/admin_list.py
a
|
b
|
|
158 | 158 | if value is None: |
159 | 159 | result_repr = EMPTY_CHANGELIST_VALUE |
160 | 160 | if isinstance(f.rel, models.ManyToOneRel): |
161 | | result_repr = escape(getattr(result, f.name)) |
| 161 | field_val = getattr(result, f.name) |
| 162 | if field_val is None: |
| 163 | result_repr = EMPTY_CHANGELIST_VALUE |
| 164 | else: |
| 165 | result_repr = escape(field_val) |
162 | 166 | else: |
163 | 167 | result_repr = display_for_field(value, f) |
164 | 168 | if isinstance(f, models.DateField) or isinstance(f, models.TimeField): |