X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/020ce4dc253c46a35c98cc718b0a1a1b8e9aceac..8a7500e86bc3acd030d91c29eb694fac53d0c906:/tasklib/task.py 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