[1.6.x] Fixed backport error in previous commit; refs #15961

This commit is contained in:
Tim Graham 2013-08-04 07:30:30 -04:00
parent 9053c6da5f
commit 90bdb42702
1 changed files with 2 additions and 3 deletions

View File

@ -756,10 +756,9 @@ class ModelAdmin(BaseModelAdmin):
return "%s__icontains" % field_name
use_distinct = False
search_fields = self.get_search_fields(request)
if search_fields and search_term:
if self.search_fields and search_term:
orm_lookups = [construct_search(str(search_field))
for search_field in search_fields]
for search_field in self.search_fields]
for bit in search_term.split():
or_queries = [models.Q(**{orm_lookup: bit})
for orm_lookup in orm_lookups]