X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/72bbb2d0918a56833385938654cc575fbf5af735..15c5d693afb61c72f6a6984c25dacb8610b2d9a8:/tasklib/task.py?ds=sidebyside diff --git a/tasklib/task.py b/tasklib/task.py index 7c6dff8..3f53511 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -586,7 +586,7 @@ class Task(TaskResource): if self.deleted: raise Task.DeletedTask("Task was already deleted") - self.warrior.execute_command([self['uuid'], 'delete']) + self.backend.delete_task(self) # Refresh the status again, so that we have updated info stored self.refresh(only_fields=['status', 'start', 'end']) @@ -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'])