mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-28 04:24:00 +03:00
Fix tests
This commit is contained in:
parent
a82e23c0ff
commit
731c63fb0f
|
@ -52,11 +52,11 @@ class SearchFilter(BaseFilterBackend):
|
||||||
|
|
||||||
def get_search_fields(self, view, request):
|
def get_search_fields(self, view, request):
|
||||||
"""
|
"""
|
||||||
Search fields are obtained from the view / search backend, but the request is
|
Search fields are obtained from the search backend / view, but the request is
|
||||||
always passed to this method. Sub-classes can override this method to
|
always passed to this method. Sub-classes can override this method to
|
||||||
dynamically change the search fields based on request content.
|
dynamically change the search fields based on request content.
|
||||||
"""
|
"""
|
||||||
return getattr(self, 'search_fields', getattr(view, 'search_fields'))
|
return getattr(self, 'search_fields') or getattr(view, 'search_fields', None)
|
||||||
|
|
||||||
def get_search_terms(self, request):
|
def get_search_terms(self, request):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user