Skip to content

Commit 28db4e4

Browse files
sti0sergey-p3Timo Schneider
authored andcommitted
[Bitbucket] Fix pagination for cloud requests **FIX BLACK** (#872)
* [Bitbucket] Fix pagination for cloud requests Exception raised when requesting pull requests which exceed single page: requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.bitbucket.org/2.0/repositories/XXXX/pullrequests/?q=state+%3D+%22OPEN%22+OR+state+%3D+%22MERGED%22+or+state%3D%22DECLINED%22&page=2/&q=state+%3D+%22OPEN%22+OR+state+%3D+%22MERGED%22+or+state%3D%22DECLINED%22 Next argument returned by the response contains full url including original params and next page. The issue is that the params are passed as duplicates to the following request along with the trailing / after provided url. * Fix black Co-authored-by: Sergey <sergey.pusnei@gmail.com> Co-authored-by: Timo Schneider <timo.schneider@intersport.de>
1 parent 1c7b8d3 commit 28db4e4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

atlassian/bitbucket/cloud/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ def _get_paged(
7878
break
7979
# From now on we have absolute URLs with parameters
8080
absolute = True
81-
params = None
81+
# Params are now provided by the url
82+
params = {}
83+
# Trailing should not be added as it is already part of the url
84+
trailing = False
8285

8386
return

0 commit comments

Comments
 (0)