mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 05:20:12 +03:00
Fix Issue #3596
Check if view has a filter_class. If not, skip trying to get and append a filter html element for it.
This commit is contained in:
parent
316c374b02
commit
bdf3aeddde
|
@ -592,9 +592,12 @@ class BrowsableAPIRenderer(BaseRenderer):
|
||||||
elements = []
|
elements = []
|
||||||
for backend in view.filter_backends:
|
for backend in view.filter_backends:
|
||||||
if hasattr(backend, 'to_html'):
|
if hasattr(backend, 'to_html'):
|
||||||
html = backend().to_html(request, queryset, view)
|
if not hasattr(view, 'filter_class'):
|
||||||
if html:
|
return
|
||||||
elements.append(html)
|
else:
|
||||||
|
html = backend().to_html(request, queryset, view)
|
||||||
|
if html:
|
||||||
|
elements.append(html)
|
||||||
|
|
||||||
if not elements:
|
if not elements:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue
Block a user