Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
dashboard
Commits
cb8221c3
Commit
cb8221c3
authored
May 31, 2021
by
Guilhem Saurel
Browse files
fix api_list limit
parent
e6a71eac
Pipeline
#14764
failed with stage
in 3 minutes and 25 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rainboard/models.py
View file @
cb8221c3
...
@@ -509,7 +509,7 @@ class Repo(TimeStampedModel):
...
@@ -509,7 +509,7 @@ class Repo(TimeStampedModel):
req
=
self
.
api_req
(
url
)
req
=
self
.
api_req
(
url
)
return
req
.
json
()
if
req
.
status_code
==
200
else
[]
# TODO
return
req
.
json
()
if
req
.
status_code
==
200
else
[]
# TODO
def
api_list
(
self
,
url
=
''
,
name
=
None
):
def
api_list
(
self
,
url
=
''
,
name
=
None
,
limit
=
None
):
page
=
1
page
=
1
while
page
:
while
page
:
req
=
self
.
api_req
(
url
,
name
,
page
)
req
=
self
.
api_req
(
url
,
name
,
page
)
...
@@ -523,6 +523,8 @@ class Repo(TimeStampedModel):
...
@@ -523,6 +523,8 @@ class Repo(TimeStampedModel):
return
[]
# TODO
return
[]
# TODO
yield
from
data
yield
from
data
page
=
api_next
(
self
.
forge
.
source
,
req
)
page
=
api_next
(
self
.
forge
.
source
,
req
)
if
limit
is
not
None
and
page
>
limit
:
break
def
api_update
(
self
):
def
api_update
(
self
):
data
=
self
.
api_data
()
data
=
self
.
api_data
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment