Housekeeping: a null page is an empty one (#182)
Housekeeping: a null page is an empty one (#182) Gitea answers an issue nobody reacted to with null; the signal step failed on it today. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
This commit was merged in pull request #182.
This commit is contained in:
1 parent
805e20d695
commit
d235afb7f3
3 files changed
+5
-3
No files matched your search
@@ -46,7 +46,7 @@ def paged(path: str, pages: int = 40) -> list[dict]:
|
||||
sep = "&" if "?" in path else "?"
|
||||
out: list[dict] = []
|
||||
for page in range(1, pages + 1):
|
||||
batch = tm.gh("GET", f"{path}{sep}limit=50&page={page}")
|
||||
batch = tm.gh("GET", f"{path}{sep}limit=50&page={page}") or [] # Gitea answers an issue with no reactions with null
|
||||
out += batch
|
||||
if len(batch) < 50:
|
||||
break
|
||||
|
||||
@@ -64,8 +64,9 @@ class Forge:
|
||||
if m["id"] == int(route.split("/")[-1]):
|
||||
m.update(body)
|
||||
return {}
|
||||
if route.endswith("/reactions"):
|
||||
return self.page(self.reactions.get(int(route.split("/")[-2]), []), path)
|
||||
if route.endswith("/reactions"): # Gitea: null, not [], for an issue nobody reacted to
|
||||
n = int(route.split("/")[-2])
|
||||
return self.page(self.reactions[n], path) if n in self.reactions else None
|
||||
if route.endswith("/comments") and method == "GET":
|
||||
return self.page(self.cmts.get(int(route.split("/")[-2]), []), path)
|
||||
if route.endswith("/comments") and method == "POST":
|
||||
|
||||
Reference in new issue
Block a user