Merge pull request #3705 from mcastle/patch-2

Admin and API browser fails for views without a filter_class
This commit is contained in:
Tom Christie 2015-12-07 10:10:24 +00:00
commit c227b8188e

View File

@ -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
} }