diff --git a/django/contrib/admin/validation.py b/django/contrib/admin/validation.py
index fa6d7e3..4b27439 100644
a
|
b
|
def validate(cls, model):
|
71 | 71 | raise ImproperlyConfigured("'%s.list_editable' cannot be used " |
72 | 72 | "without a default ordering. Please define ordering on either %s or %s." |
73 | 73 | % (cls.__name__, cls.__name__, model.__name__)) |
74 | | for idx, field in enumerate(cls.list_editable): |
| 74 | for idx, field_name in enumerate(cls.list_editable): |
75 | 75 | try: |
76 | | opts.get_field_by_name(field) |
| 76 | field = opts.get_field_by_name(field_name)[0] |
77 | 77 | except models.FieldDoesNotExist: |
78 | 78 | raise ImproperlyConfigured("'%s.list_editable[%d]' refers to a " |
79 | | "field, '%s', not defiend on %s." % (cls.__name__, idx, field, model.__name__)) |
80 | | if field not in cls.list_display: |
| 79 | "field, '%s', not defiend on %s." % (cls.__name__, idx, field_name, model.__name__)) |
| 80 | if field_name not in cls.list_display: |
81 | 81 | raise ImproperlyConfigured("'%s.list_editable[%d]' refers to " |
82 | 82 | "'%s' which is not defined in 'list_display'." |
83 | | % (cls.__name__, idx, field)) |
84 | | if field in cls.list_display_links: |
| 83 | % (cls.__name__, idx, field_name)) |
| 84 | if field_name in cls.list_display_links: |
85 | 85 | raise ImproperlyConfigured("'%s' cannot be in both '%s.list_editable'" |
86 | 86 | " and '%s.list_display_links'" |
87 | | % (field, cls.__name__, cls.__name__)) |
88 | | |
| 87 | % (field_name, cls.__name__, cls.__name__)) |
| 88 | if not field.editable: |
| 89 | raise ImproperlyConfigured("'%s.list_editable[%d]' refers to a " |
| 90 | "field, '%s', which isn't editable through the admin." |
| 91 | % (cls.__name__, idx, field_name)) |
89 | 92 | |
90 | 93 | # search_fields = () |
91 | 94 | if hasattr(cls, 'search_fields'): |