mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.8.x] Fixed #24851 -- Fixed crash with reverse one-to-one relation in ModelAdmin.list_display
This commit is contained in:
@@ -200,7 +200,7 @@ def items_for_result(cl, result, form):
|
||||
except ObjectDoesNotExist:
|
||||
result_repr = EMPTY_CHANGELIST_VALUE
|
||||
else:
|
||||
if f is None:
|
||||
if f is None or f.auto_created:
|
||||
if field_name == 'action_checkbox':
|
||||
row_classes = ['action-checkbox']
|
||||
allow_tags = getattr(attr, 'allow_tags', False)
|
||||
|
||||
@@ -383,7 +383,7 @@ class ChangeList(object):
|
||||
except FieldDoesNotExist:
|
||||
pass
|
||||
else:
|
||||
if isinstance(field.rel, models.ManyToOneRel):
|
||||
if hasattr(field, 'rel') and isinstance(field.rel, models.ManyToOneRel):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user