X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/0b7eee0a63b5d15d2dbbba7d35cb9600c5b7bab1..8a2ba91cb471ad97094311172b86b9bf3afed725:/tasklib/task.py diff --git a/tasklib/task.py b/tasklib/task.py index ce915bf..cbc1192 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -753,6 +753,14 @@ class Task(TaskResource): # of newly saved tasks. Any other place in the code is fine # with using UUID only. args = [self['uuid'] or self['id'], 'export'] + output = self.warrior.execute_command(args) + + # If more than 1 task has been matched, raise exception + if len(output) > 1: + raise TaskWarriorException( + "Unique identifier {0} matches multiple tasks: {1}".format( + self['uuid'] or self['id'], output)) + new_data = json.loads(self.warrior.execute_command(args)[0]) if only_fields: to_update = dict(