Commit 7fb3f078 by Alexander Akhmetov Committed by Alexander Akhmetov

fix for python3

parent 316de3a8
......@@ -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):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment