From 65df9fd5c6820733b7ba0ec78152bfffb01301db Mon Sep 17 00:00:00 2001 From: Rikuoja Date: Mon, 24 Aug 2015 17:02:49 +0300 Subject: [PATCH] Fix #3323 --- rest_framework/filters.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rest_framework/filters.py b/rest_framework/filters.py index 931263670..90c19aba0 100644 --- a/rest_framework/filters.py +++ b/rest_framework/filters.py @@ -102,15 +102,16 @@ class SearchFilter(BaseFilterBackend): def filter_queryset(self, request, queryset, view): search_fields = getattr(view, 'search_fields', None) - orm_lookups = [ - self.construct_search(six.text_type(search_field)) - for search_field in search_fields - ] search_terms = self.get_search_terms(request) if not search_fields or not search_terms: return queryset + orm_lookups = [ + self.construct_search(six.text_type(search_field)) + for search_field in search_fields + ] + base = queryset for search_term in search_terms: queries = [