From: Tomas Babej Date: Thu, 26 Mar 2015 00:18:49 +0000 (+0100) Subject: Task: Stop before marking as done with older TW versions X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/8a7500e86bc3acd030d91c29eb694fac53d0c906?ds=inline;hp=-c Task: Stop before marking as done with older TW versions --- 8a7500e86bc3acd030d91c29eb694fac53d0c906 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