[patch] Using a non-field in "admin.list_display_links" raises misleading exception
|Reported by:||Owned by:||Adrian Holovaty|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
A model's "admin.list_display" will happily accept non-fields. If the first listed item is a non-field it is linked to the object change page, as a field would be. However, if a non-field is listed in "admin.list_display_links" a misleading exception is raised.
ex: "admin.list_filter" refers to 'example', which isn't a field.
This message is obviously incorrect (referring to "admin.list_filter", not "admin.list_display_links"), and the check itself seems redundant.
The valid field check can seemingly be removed; at worst, the exception message should be altered actually refer to "admin.list_display_links".
Change History (7)
comment:1 Changed 11 years ago by
|Summary:||Using a non-field in "admin.list_display_links" raises misleading exception → [patch] Using a non-field in "admin.list_display_links" raises misleading exception|