From ca56e9fddf577f3f33ec9858c0bb5de0dc7af239 Mon Sep 17 00:00:00 2001 From: bliu Date: Tue, 2 Aug 2016 17:11:50 +0800 Subject: [PATCH] Disable pagination when page-size is 0 or -1 When page-size setting with 0 or -1, it will disable the pagination. JIRA: PDC-1636 --- pdc_client/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pdc_client/__init__.py b/pdc_client/__init__.py index 5b980b5..6af32c0 100644 --- a/pdc_client/__init__.py +++ b/pdc_client/__init__.py @@ -193,6 +193,11 @@ def get_paged(self, res, **kwargs): if self.page_size: kwargs['page_size'] = self.page_size + if self.page_size in [0, -1]: + # When page-size is 0 or -1, which disable pagination. + kwargs['page_size'] = self.page_size + return res(**kwargs) + def worker(): kwargs['page'] = 1 while True: