X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/7b0f22cf6cf519ece57e5282412669f460859293..15c5d693afb61c72f6a6984c25dacb8610b2d9a8:/tasklib/task.py diff --git a/tasklib/task.py b/tasklib/task.py index 61f944a..3f53511 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -605,7 +605,7 @@ class Task(TaskResource): elif self.active: raise Task.ActiveTask("Task is already active") - self.warrior.execute_command([self['uuid'], 'start']) + self.backend.start_task(self) # Refresh the status again, so that we have updated info stored self.refresh(only_fields=['status', 'start']) @@ -620,7 +620,7 @@ class Task(TaskResource): if not self.active: raise Task.InactiveTask("Cannot stop an inactive task") - self.warrior.execute_command([self['uuid'], 'stop']) + self.backend.stop_task(self) # Refresh the status again, so that we have updated info stored self.refresh(only_fields=['status', 'start']) @@ -637,11 +637,7 @@ 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']) + self.backend.complete_task(self) # Refresh the status again, so that we have updated info stored self.refresh(only_fields=['status', 'start', 'end'])