mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50: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 = []
|
||||
for backend in view.filter_backends:
|
||||
if hasattr(backend, 'to_html'):
|
||||
html = backend().to_html(request, queryset, view)
|
||||
if html:
|
||||
elements.append(html)
|
||||
if not hasattr(view, 'filter_class'):
|
||||
return
|
||||
else:
|
||||
html = backend().to_html(request, queryset, view)
|
||||
if html:
|
||||
elements.append(html)
|
||||
|
||||
if not elements:
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue
Block a user