Skip to content

Commit 5b3088b

Browse files
authored
[RestClient] Enfore PR limit when using server (#588)
When pulling PRs from bitbucket server, the limit url parameter doesn't seem to be beeing heeded. This change allows the library to prevent too many PRs from being returned to the client.
1 parent 591d674 commit 5b3088b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

atlassian/bitbucket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ def get_pull_requests(self, project, repository, state='OPEN', order='newest', l
801801
pr_list.extend(response.get("values", []))
802802

803803
else:
804-
while not response.get('isLastPage'):
804+
while not response.get('isLastPage') and len(pr_list) < limit:
805805
start = response.get('nextPageStart')
806806
params['start'] = start
807807
response = self.get(url, params=params)

0 commit comments

Comments
 (0)