Skip to content

Commit

Permalink
[1.6.x] Fixed backport error in previous commit; refs #15961
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham committed Aug 4, 2013
1 parent 9053c6d commit 90bdb42
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions django/contrib/admin/options.py
Expand Up @@ -756,10 +756,9 @@ def construct_search(field_name):
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]
Expand Down

0 comments on commit 90bdb42

Please sign in to comment.