fix: skip malformed pull request entries (#83)
This commit is contained in:
1 parent
49ce2d9945
commit
77404cfd03
2 files changed
+37
No files matched your search
@@ -119,6 +119,10 @@ async def context() -> JSONResponse:
|
||||
PullRequest(id=p["id"], number=p["number"], title=p["title"], state=p["state"], user=(p.get("user") or {}).get("login", ""), url=p["html_url"])
|
||||
for p in (prs_data or [])[:50]
|
||||
if isinstance(p, dict)
|
||||
and all(
|
||||
field in p
|
||||
for field in ("id", "number", "title", "state", "html_url")
|
||||
)
|
||||
]
|
||||
ctx = compute(user_model, repo_models, issue_models, pr_models)
|
||||
return JSONResponse(ctx.model_dump())
|
||||
|
||||
Reference in new issue
Block a user