X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/96ba7d696fe1ca16ac053e4d1b7403ae8604d2e1..a39f27ce1b92af11794fde4f0b7badc8a39d0d6f:/tasklib/task.py?ds=sidebyside diff --git a/tasklib/task.py b/tasklib/task.py index 8ee77fd..9b3626d 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -110,9 +110,10 @@ class SerializingObject(object): return tags.split(',') if tags else [] return tags or [] - def serialize_depends(self, cur_dependencies): + def serialize_depends(self, value): # Return the list of uuids - return ','.join(task['uuid'] for task in cur_dependencies) + value = value if value is not None else set() + return ','.join(task['uuid'] for task in value) def deserialize_depends(self, raw_uuids): raw_uuids = raw_uuids or '' # Convert None to empty string @@ -329,7 +330,7 @@ class Task(TaskResource): def serialize_depends(self, cur_dependencies): # Check that all the tasks are saved - for task in cur_dependencies: + for task in (cur_dependencies or set()): if not task.saved: raise Task.NotSaved('Task \'%s\' needs to be saved before ' 'it can be set as dependency.' % task)