diff --git a/rest_framework/filters.py b/rest_framework/filters.py index 4eb7d6cca..a62139405 100644 --- a/rest_framework/filters.py +++ b/rest_framework/filters.py @@ -117,9 +117,9 @@ class DjangoFilterBackend(BaseFilterBackend): return queryset def to_html(self, request, queryset, view): - cls = self.get_filter_class(view, queryset) - if cls: - filter_instance = cls(request.query_params, queryset=queryset) + filter_class = self.get_filter_class(view, queryset) + if filter_class: + filter_instance = filter_class(request.query_params, queryset=queryset) else: filter_instance = None context = Context({