Skip to content

Commit 311e17f

Browse files
committed
Merge pull request pyapi-gitlab#122 from aneroid/no_pagination
Remove Pagination for GetDeployKeys and GetBranches
2 parents 95397c9 + 3b16e5e commit 311e17f

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

gitlab/__init__.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,12 @@ def edituser(self, user_id, **kwargs):
183183
else:
184184
return False
185185

186-
def getsshkeys(self, page=1, per_page=20):
186+
def getsshkeys(self):
187187
"""Gets all the ssh keys for the current user
188188
189189
:return: a dictionary with the lists
190190
"""
191-
data = {'page': page, 'per_page': per_page}
192-
request = requests.get(self.keys_url, headers=self.headers, params=data,
191+
request = requests.get(self.keys_url, headers=self.headers,
193192
verify=self.verify_ssl)
194193
if request.status_code == 200:
195194
return json.loads(request.content.decode("utf-8"))
@@ -626,14 +625,13 @@ def deletesystemhook(self, hook_id):
626625
else:
627626
return False
628627

629-
def getbranches(self, project_id, page=1, per_page=20):
628+
def getbranches(self, project_id):
630629
"""List all the branches from a project
631630
632631
:param project_id: project id
633632
:return: the branches
634633
"""
635-
data = {'page': page, 'per_page': per_page}
636-
request = requests.get("{0}/{1}/repository/branches".format(self.projects_url, project_id), params=data,
634+
request = requests.get("{0}/{1}/repository/branches".format(self.projects_url, project_id),
637635
headers=self.headers, verify=self.verify_ssl)
638636
if request.status_code == 200:
639637
return json.loads(request.content.decode("utf-8"))
@@ -917,14 +915,13 @@ def editmilestone(self, project_id, milestone_id, **kwargs):
917915

918916
return False
919917

920-
def getdeploykeys(self, project_id, page=1, per_page=20):
918+
def getdeploykeys(self, project_id):
921919
"""Get a list of a project's deploy keys.
922920
923921
:param project_id: project id
924922
:return: the keys in a dictionary if success, false if not
925923
"""
926-
data = {'page': page, 'per_page': per_page}
927-
request = requests.get("{0}/{1}/keys".format(self.projects_url, project_id), params=data,
924+
request = requests.get("{0}/{1}/keys".format(self.projects_url, project_id),
928925
headers=self.headers, verify=self.verify_ssl)
929926
if request.status_code == 200:
930927
return json.loads(request.content.decode("utf-8"))

0 commit comments

Comments
 (0)