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):
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
}