aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework
diff options
context:
space:
mode:
Diffstat (limited to 'rest_framework')
-rw-r--r--rest_framework/generics.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/rest_framework/generics.py b/rest_framework/generics.py
index 33affee8..ce6c462a 100644
--- a/rest_framework/generics.py
+++ b/rest_framework/generics.py
@@ -212,12 +212,15 @@ class GenericAPIView(views.APIView):
except (KeyError, ValueError):
pass
else:
- if self.max_paginate_by:
+ if self.max_paginate_by is not None:
return min(self.max_paginate_by, paginate_by_param)
else:
return paginate_by_param
- return min(self.max_paginate_by, self.paginate_by) or self.paginate_by
+ if self.max_paginate_by:
+ return min(self.max_paginate_by, self.paginate_by)
+ else:
+ return self.paginate_by
def get_serializer_class(self):
"""