From 548ac9a65eb9d399836c2c3eae982b79cd60ee49 Mon Sep 17 00:00:00 2001 From: iorlas Date: Wed, 8 Apr 2015 20:32:02 +0300 Subject: [PATCH] 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. --- rest_framework/renderers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/renderers.py b/rest_framework/renderers.py index 2350344c6..6c7cdf537 100644 --- a/rest_framework/renderers.py +++ b/rest_framework/renderers.py @@ -611,7 +611,7 @@ class BrowsableAPIRenderer(BaseRenderer): 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