summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Wittig <max.wittig@siemens.com>2020-06-09 11:39:43 +0200
committerMax Wittig <max.wittig@siemens.com>2020-06-09 13:23:16 +0200
commite71fe16b47835aa4db2834e98c7ffc6bdec36723 (patch)
tree1969fe2ca0f2ca00a37de92e770456187bee735e
parent1f7dbc8dfb9c200d31ce8fad06feb235cade1481 (diff)
downloadgitlab-e71fe16b47835aa4db2834e98c7ffc6bdec36723.tar.gz
fix: disable default keyset pagination
Instead we set pagination to offset on the other paths
-rw-r--r--gitlab/__init__.py10
-rw-r--r--tools/python_test_v4.py1
2 files changed, 1 insertions, 10 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py
index d02389d..1439be7 100644
--- a/gitlab/__init__.py
+++ b/gitlab/__init__.py
@@ -643,17 +643,7 @@ class Gitlab(object):
get_all = kwargs.pop("all", False)
url = self._build_url(path)
- order_by = kwargs.get("order_by")
- pagination = kwargs.get("pagination")
page = kwargs.get("page")
- if (
- path in ALLOWED_KEYSET_ENDPOINTS
- and (not order_by or order_by == "id")
- and (not pagination or pagination == "keyset")
- and not page
- ):
- kwargs["pagination"] = "keyset"
- kwargs["order_by"] = "id"
if get_all is True and as_list is True:
return list(GitlabList(self, url, query_data, **kwargs))
diff --git a/tools/python_test_v4.py b/tools/python_test_v4.py
index 70dc3f9..c43eebd 100644
--- a/tools/python_test_v4.py
+++ b/tools/python_test_v4.py
@@ -421,6 +421,7 @@ sudo_project = gl.projects.create({"name": "sudo_project"}, sudo=user1.name)
assert len(gl.projects.list(owned=True)) == 2
assert len(gl.projects.list(search="admin")) == 1
+assert len(gl.projects.list(as_list=False)) == 4
# test pagination
l1 = gl.projects.list(per_page=1, page=1)