File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 11from typing import List
22from typing import Optional
33
4+ from .common import GiteaModel
45from .connection import Connection
56from .connection import GiteaHTTPResponse
67
78
8- class SSHKey :
9- def __init__ (self , data : dict , * , response : Optional [GiteaHTTPResponse ] = None ):
10- self ._data = data
11- self ._response = response
12-
9+ class SSHKey (GiteaModel ):
1310 @property
1411 def id (self ) -> int :
1512 return self ._data ["id" ]
@@ -43,11 +40,13 @@ def list(cls, conn: Connection) -> List["SSHKey"]:
4340 :param conn: Gitea ``Connection`` instance.
4441 """
4542 q = {
46- "limit" : - 1 ,
43+ "limit" : 50 ,
4744 }
4845 url = conn .makeurl ("user" , "keys" , query = q )
4946 response = conn .request ("GET" , url )
50- obj_list = [cls (i , response = response ) for i in response .json ()]
47+ obj_list = []
48+ for response in conn .request_all_pages ("GET" , url ):
49+ obj_list .extend ([cls (i , response = response , conn = conn ) for i in response .json () or []])
5150 return obj_list
5251
5352 @classmethod
You can’t perform that action at this time.
0 commit comments