From 87f08d5c407f98f2711694160fcac7484520e445 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 30 Aug 2019 18:46:13 +0100 Subject: [PATCH] Ignore tasks with no defined todoist project --- actioner/scheduler/todoist_assigned_issues.py | 2 ++ actioner/scheduler/todoist_repo_prs.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/actioner/scheduler/todoist_assigned_issues.py b/actioner/scheduler/todoist_assigned_issues.py index 4b9b16f..4200c1f 100644 --- a/actioner/scheduler/todoist_assigned_issues.py +++ b/actioner/scheduler/todoist_assigned_issues.py @@ -36,6 +36,8 @@ def todoist_assigned_issues(): todoist.items.sync() for issue in get_relevant_issues(): project_id = get_todoist_project_from_repo(issue.repository.full_name) + if not project_id: + continue existing_tasks = get_existing_tasks(project_id, todoist) me_assigned = me.login in {assignee.login for assignee in issue.assignees} existing_task_id = get_existing_task(existing_tasks, issue) diff --git a/actioner/scheduler/todoist_repo_prs.py b/actioner/scheduler/todoist_repo_prs.py index ba57b35..2e4cdef 100644 --- a/actioner/scheduler/todoist_repo_prs.py +++ b/actioner/scheduler/todoist_repo_prs.py @@ -30,6 +30,8 @@ def todoist_repo_prs(): todoist.items.sync() for repo_name in REPOS: project_id = get_todoist_project_from_repo(repo_name) + if not project_id: + continue existing_tasks = { item["id"]: item["content"] for item in todoist.state["items"]