From 69e72daff489ba4db39decaaac6d0cc5eb413bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jochum?= Date: Wed, 9 Oct 2019 10:14:27 +0200 Subject: [PATCH] Taskwarrior doesn't like status=wating, don't send it. --- todoist_taskwarrior/cli.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/todoist_taskwarrior/cli.py b/todoist_taskwarrior/cli.py index b1342e4..c579df7 100644 --- a/todoist_taskwarrior/cli.py +++ b/todoist_taskwarrior/cli.py @@ -382,8 +382,11 @@ def _ti_update_task(tw_task, ti_project_list): elif ti_task['item']['checked'] == 0 and \ tw_task['status'] == 'completed': todoist.items.complete(tid) + elif tw_task['status'] == 'waiting': + # taskwarrior doesn't like status=waiting + del(tw_task['status']) - tw_task['todoist_sync'] = datetime.datetime.now() + tw_task['todoist_sync'] = datetime.datetime.now().isoformat() taskwarrior.task_update(tw_task) else: # Always set latest sync time so no more sync accures @@ -391,7 +394,11 @@ def _ti_update_task(tw_task, ti_project_list): log.info(f'TI updating (todoist_id={tid})...', nl=False) log.success('OK') - tw_task['todoist_sync'] = datetime.datetime.now() + # taskwarrior doesn't like status=waiting + if tw_task['status'] == 'waiting': + del(tw_task['status']) + + tw_task['todoist_sync'] = datetime.datetime.now().isoformat() taskwarrior.task_update(tw_task)