Skip to content

Commit 548ac9a

Browse files
committed
Now it is possible to display viewset w/o paginator
Since pagination is now included in every generic viewset, we should have ability to disable it and we have it: paginator=None or pagination_class=None. But this piece of code relies on existence of property instead of its value.
1 parent 311cad6 commit 548ac9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_framework/renderers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ def get_context(self, data, accepted_media_type, renderer_context):
611611
renderer_content_type += ' ;%s' % renderer.charset
612612
response_headers['Content-Type'] = renderer_content_type
613613

614-
if hasattr(view, 'paginator') and view.paginator.display_page_controls:
614+
if getattr(view, 'paginator', None) and view.paginator.display_page_controls:
615615
paginator = view.paginator
616616
else:
617617
paginator = None

0 commit comments

Comments
 (0)