summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Piron <jonathan.piron@cybelangel.com>2019-02-18 11:13:49 +0100
committerJonathan Piron <jonathan.piron@cybelangel.com>2019-02-18 11:13:49 +0100
commit6b2bf5b29c235243c11bbc994e7f2540a6a3215e (patch)
tree5d38fa8e5b3a3b7b8bf41684b225b4f99dbf1cf0
parent31bca2f9ee55ffa69d34f4584e90da01d3f6325e (diff)
downloadgitlab-6b2bf5b29c235243c11bbc994e7f2540a6a3215e.tar.gz
Fix all kwarg behaviour
`all` kwarg is used to manage GitlabList generator behaviour. However, as it is not poped from kwargs, it is sent to Gitlab API. Some endpoints such as [the project commits](https://docs.gitlab.com/ee/api/commits.html#list-repository-commits) one, support a `all` attribute. This means a call like `project.commits.list(all=True, ref_name='master')` won't return all the master commits as one might expect but all the repository's commits. To prevent confusion, the same kwarg shouldn't be used for 2 distinct purposes. Moreover according to [the documentation](https://python-gitlab.readthedocs.io/en/stable/gl_objects/commits.html#examples), the `all` project commits API endpoint attribute doesn't seem supported.
-rw-r--r--gitlab/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py
index 0e6e52f..48f8da5 100644
--- a/gitlab/__init__.py
+++ b/gitlab/__init__.py
@@ -590,7 +590,7 @@ class Gitlab(object):
# In case we want to change the default behavior at some point
as_list = True if as_list is None else as_list
- get_all = kwargs.get('all', False)
+ get_all = kwargs.pop('all', False)
url = self._build_url(path)
if get_all is True: