mirror of
https://github.com/openSUSE/osc.git
synced 2025-11-24 22:02:10 +01:00
Fix gitea_api.PullRequest.list() to use pagination instead of limit -1
This commit is contained in:
@@ -448,11 +448,12 @@ class PullRequest(GiteaModel):
|
||||
|
||||
q = {
|
||||
"state": state,
|
||||
"limit": -1,
|
||||
"limit": 50,
|
||||
}
|
||||
url = conn.makeurl("repos", owner, repo, "pulls", query=q)
|
||||
response = conn.request("GET", url)
|
||||
obj_list = [cls(i, response=response, conn=conn) for i in response.json()]
|
||||
obj_list = []
|
||||
for response in conn.request_all_pages("GET", url):
|
||||
obj_list.extend([cls(i, response=response, conn=conn) for i in response.json()])
|
||||
return obj_list
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user