Fail the read when Lever answers something other than a list or Oracle an answer without its search wrapper, instead of reading an empty board that is complete
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
19fb73caa0
commit
85aed0807b
4 files changed
+67
-5
No files matched your search
@@ -112,9 +112,13 @@ def _places(categories: dict[str, Any]) -> list[Place]:
|
||||
|
||||
|
||||
def parse(body: bytes, slug: str) -> list[Row]:
|
||||
"""The board's postings, a JSON list. Any other answer (an error
|
||||
document sent with a 200) raises, so the read fails and closes nothing
|
||||
rather than reading as a board with no roles."""
|
||||
data = json.loads(body)
|
||||
if not isinstance(data, list):
|
||||
return []
|
||||
raise ValueError(f"Lever's answer is a JSON {type(data).__name__}, "
|
||||
"not a list of postings")
|
||||
rows = []
|
||||
for j in data:
|
||||
title = (j.get("text") or "").strip()
|
||||
|
||||
Reference in new issue
Block a user