Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
iorlas committed Apr 8, 2015
commit 548ac9a65eb9d399836c2c3eae982b79cd60ee49
2 changes: 1 addition & 1 deletion rest_framework/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ def get_context(self, data, accepted_media_type, renderer_context):
renderer_content_type += ' ;%s' % renderer.charset
response_headers['Content-Type'] = renderer_content_type

if hasattr(view, 'paginator') and view.paginator.display_page_controls:
if getattr(view, 'paginator', None) and view.paginator.display_page_controls:
paginator = view.paginator
else:
paginator = None
Expand Down