From 8a7500e86bc3acd030d91c29eb694fac53d0c906 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Thu, 26 Mar 2015 01:18:49 +0100 Subject: [PATCH] Task: Stop before marking as done with older TW versions --- tasklib/task.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasklib/task.py b/tasklib/task.py index fad13bd..1121988 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -633,6 +633,10 @@ class Task(TaskResource): elif self.deleted: raise Task.DeletedTask("Deleted task cannot be completed") + # Older versions of TW do not stop active task at completion + if self.warrior.version < VERSION_2_4_0 and self.active: + self.stop() + self.warrior.execute_command([self['uuid'], 'done']) # Refresh the status again, so that we have updated info stored -- 2.39.5