mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +03:00
Merge pull request #3705 from mcastle/patch-2
Admin and API browser fails for views without a filter_class
This commit is contained in:
commit
c227b8188e
|
@ -118,10 +118,9 @@ class DjangoFilterBackend(BaseFilterBackend):
|
|||
|
||||
def to_html(self, request, queryset, view):
|
||||
filter_class = self.get_filter_class(view, queryset)
|
||||
if filter_class:
|
||||
filter_instance = filter_class(request.query_params, queryset=queryset)
|
||||
else:
|
||||
filter_instance = None
|
||||
if not filter_class:
|
||||
return None
|
||||
filter_instance = filter_class(request.query_params, queryset=queryset)
|
||||
context = {
|
||||
'filter': filter_instance
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user