X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/2f50a72c1d1400edddd58ad654611422c92d852a..4c0d71c0c2a8b190249416b29b310f4afcab755b:/tasklib/task.py?ds=sidebyside diff --git a/tasklib/task.py b/tasklib/task.py index 1fa3faa..5acabe0 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -165,6 +165,8 @@ class Task(TaskResource): return self['uuid'] is not None or self['id'] is not None def serialize_due(self, date): + if not date: + return None return date.strftime(DATE_FORMAT) def deserialize_due(self, date_str): @@ -302,7 +304,8 @@ class Task(TaskResource): elif field == 'depends': args.append('{0}:{1}'.format(field, self.format_depends())) else: - args.append('{0}:{1}'.format(field, self._data[field])) + # Use empty string to substitute for None value + args.append('{0}:{1}'.format(field, self._data[field] or '')) # If we're modifying saved task, simply pass on all modified fields if self.saved: