From 802cc5a6959d31eaa27433bf3202a3fda7917f37 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 11 Jan 2020 13:06:14 +0000 Subject: [PATCH] Fix comparison and stop completing then uncompleting tasks --- todoist_github/tasks/assigned_issues.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/todoist_github/tasks/assigned_issues.py b/todoist_github/tasks/assigned_issues.py index f744d27..799592a 100644 --- a/todoist_github/tasks/assigned_issues.py +++ b/todoist_github/tasks/assigned_issues.py @@ -26,10 +26,10 @@ def assigned_issues(): if not task: continue tasks_actioned.append(task["id"]) - if assigned_issue == "closed" and not is_task_completed(task): + if assigned_issue.state == "closed" and not is_task_completed(task): print("completing", assigned_issue) task.complete() - if is_task_completed(task): + elif assigned_issue.state == "open" and is_task_completed(task): print("uncompleting task", assigned_issue) task.uncomplete() if task["content"] != issue_to_task_name(assigned_issue):