Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions django/contrib/admin/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1179,9 +1179,13 @@ def _check_search_fields(self, obj):
"""Check search_fields is a sequence."""

if not isinstance(obj.search_fields, (list, tuple)):
return must_be(
"a list or tuple", option="search_fields", obj=obj, id="admin.E126"
)
return [
checks.Error(
"The value of 'search_fields' must be a list or tuple.",
obj=obj.__class__,
id="admin.E126",
),
]
else:
return []

Expand Down