Fixed #2578 -- Give a more accurate error message for admin.list_display_links
at model validation time. Patch from Christopher Lenz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3790 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
9e05fc1598
commit
dc39762fde
|
@ -958,7 +958,8 @@ def get_validation_errors(outfile, app=None):
|
||||||
try:
|
try:
|
||||||
f = opts.get_field(fn)
|
f = opts.get_field(fn)
|
||||||
except models.FieldDoesNotExist:
|
except models.FieldDoesNotExist:
|
||||||
e.add(opts, '"admin.list_filter" refers to %r, which isn\'t a field.' % fn)
|
if not hasattr(cls, fn):
|
||||||
|
e.add(opts, '"admin.list_display_links" refers to %r, which isn\'t an attribute, method or property.' % fn)
|
||||||
if fn not in opts.admin.list_display:
|
if fn not in opts.admin.list_display:
|
||||||
e.add(opts, '"admin.list_display_links" refers to %r, which is not defined in "admin.list_display".' % fn)
|
e.add(opts, '"admin.list_display_links" refers to %r, which is not defined in "admin.list_display".' % fn)
|
||||||
# list_filter
|
# list_filter
|
||||||
|
|
Loading…
Reference in New Issue