Skip to content

Commit

Permalink
fix: allow zero page length in get_list to return complete list (#1…
Browse files Browse the repository at this point in the history
…9322) (#19340)

* fix: allow zero page length to return complete list

* fix: linting issues

[skip ci]

(cherry picked from commit b258143)

Co-authored-by: Smit Vora <smitvora203@gmail.com>
  • Loading branch information
mergify[bot] and vorasmit committed Dec 19, 2022
1 parent e200188 commit 0dfa23d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frappe/frappeclient.py
Expand Up @@ -110,7 +110,9 @@ def logout(self):
headers=self.headers,
)

def get_list(self, doctype, fields='["name"]', filters=None, limit_start=0, limit_page_length=0):
def get_list(
self, doctype, fields='["name"]', filters=None, limit_start=0, limit_page_length=None
):
"""Returns list of records of a particular type"""
if not isinstance(fields, string_types):
fields = json.dumps(fields)
Expand All @@ -119,7 +121,7 @@ def get_list(self, doctype, fields='["name"]', filters=None, limit_start=0, limi
}
if filters:
params["filters"] = json.dumps(filters)
if limit_page_length:
if limit_page_length is not None:
params["limit_start"] = limit_start
params["limit_page_length"] = limit_page_length
res = self.session.get(
Expand Down

0 comments on commit 0dfa23d

Please sign in to comment.