﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30790	`autocomplete_fields` checks restrict usage to `search_fields` being defined instead of `get_search_fields`	Chad G Hansen	nobody	"It looks like in django.contrib.admin.options (https://github.com/django/django/blob/master/django/contrib/admin/options.py) all references to retrieving `search_fields` are done through a call to `get_search_fields`.

However, the checks setup for the autocomplete fields feature only check to see if search_fields is defined and not if `get_search_fields` returns something.

https://github.com/django/django/blob/master/django/contrib/admin/checks.py#L189

I'm proposing this line:

`elif not related_admin.search_fields:`

Be changed to also work when `get_search_fields` returns something:

`elif not related_admin.search_fields and not related_admin.get_search_fields(None):`

I'm changed this in my local version of Django that I have installed in my project and it works!"	Bug	closed	contrib.admin	2.2	Normal	wontfix			Unreviewed	0	0	0	0	0	0
