From b43889b47604eebced430597a13b8c6ad8fc1498 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 21 Dec 2020 22:47:22 +0000 Subject: [PATCH] Don't pass urgency:0 to taskwarrior 2.5.2 When modifying a task in taskwarrior 2.5.2 it was returning this error: The 'urgency' attribute does not allow a value of '0'. The solution is to drop the urgency argument if the value is 0 when calling task modify. --- taskw/warrior.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/taskw/warrior.py b/taskw/warrior.py index 87793b2..8c3c842 100644 --- a/taskw/warrior.py +++ b/taskw/warrior.py @@ -799,6 +799,9 @@ def task_update(self, task): if 'annotations' in task_to_modify: del task_to_modify['annotations'] + if task_to_modify.get('urgency') == 0: + del task_to_modify['urgency'] + modification = taskw.utils.encode_task_experimental(task_to_modify) # Only try to modify the task if there are changes to post here # (changes *might* just be in annotations).