fix: list tasks via project endpoint, filter undone+labelled
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
06c576b024
commit
69d40646be
1 changed files with 5 additions and 2 deletions
|
|
@ -89,7 +89,7 @@ def list_todo_tasks(vikunja_token: str) -> list[dict]:
|
|||
page = 1
|
||||
while True:
|
||||
resp = httpx.get(
|
||||
f"{VIKUNJA_BASE_URL}/api/v1/projects/{VIKUNJA_PROJECT_ID}/views/{VIKUNJA_KANBAN_VIEW_ID}/buckets/{VIKUNJA_TODO_BUCKET_ID}/tasks",
|
||||
f"{VIKUNJA_BASE_URL}/api/v1/projects/{VIKUNJA_PROJECT_ID}/tasks",
|
||||
headers={"Authorization": f"Bearer {vikunja_token}"},
|
||||
params={"page": page, "per_page": 50},
|
||||
timeout=15,
|
||||
|
|
@ -102,7 +102,10 @@ def list_todo_tasks(vikunja_token: str) -> list[dict]:
|
|||
if len(batch) < 50:
|
||||
break
|
||||
page += 1
|
||||
return tasks
|
||||
# Tasks in Todo bucket have done=False and agent label.
|
||||
# Since done tasks are marked done=True, filtering undone tasks
|
||||
# with an agent label is sufficient.
|
||||
return [t for t in tasks if not t.get("done") and t.get("labels")]
|
||||
|
||||
|
||||
def extract_agent_role(task: dict) -> str | None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue