Fixed regression introduced in r9550

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9563 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant 2008-12-03 15:47:19 +00:00
parent a44d0aace3
commit d192236a3d
1 changed files with 2 additions and 0 deletions

View File

@ -36,6 +36,8 @@ def validate(cls, model):
except models.FieldDoesNotExist: except models.FieldDoesNotExist:
raise ImproperlyConfigured("%s.list_display[%d], %r is not a callable or an attribute of %r or found in the model %r." raise ImproperlyConfigured("%s.list_display[%d], %r is not a callable or an attribute of %r or found in the model %r."
% (cls.__name__, idx, field, cls.__name__, model._meta.object_name)) % (cls.__name__, idx, field, cls.__name__, model._meta.object_name))
else:
# getattr(model, field) could be an X_RelatedObjectsDescriptor
f = fetch_attr(cls, model, opts, "list_display[%d]" % idx, field) f = fetch_attr(cls, model, opts, "list_display[%d]" % idx, field)
if isinstance(f, models.ManyToManyField): if isinstance(f, models.ManyToManyField):
raise ImproperlyConfigured("'%s.list_display[%d]', '%s' is a ManyToManyField which is not supported." raise ImproperlyConfigured("'%s.list_display[%d]', '%s' is a ManyToManyField which is not supported."