Fix tests

This commit is contained in:
Adam Dobrawy 2023-03-28 16:43:53 +02:00
parent a82e23c0ff
commit 731c63fb0f
No known key found for this signature in database

View File

@ -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):
""" """