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):
|
def to_html(self, request, queryset, view):
|
||||||
filter_class = self.get_filter_class(view, queryset)
|
filter_class = self.get_filter_class(view, queryset)
|
||||||
if filter_class:
|
if not filter_class:
|
||||||
filter_instance = filter_class(request.query_params, queryset=queryset)
|
return None
|
||||||
else:
|
filter_instance = filter_class(request.query_params, queryset=queryset)
|
||||||
filter_instance = None
|
|
||||||
context = {
|
context = {
|
||||||
'filter': filter_instance
|
'filter': filter_instance
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user