Skip to content

Commit

Permalink
Disable pagination when page-size is 0 or -1
Browse files Browse the repository at this point in the history
When page-size setting with 0 or -1, it will disable the pagination.

JIRA: PDC-1636
  • Loading branch information
bliuredhat committed Aug 3, 2016
1 parent 92eb50c commit ca56e9f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pdc_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ca56e9f

Please sign in to comment.