From f881626c51f4a954f0330ef141b1b3ff944e35df Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Mon, 23 May 2016 22:12:36 +0200 Subject: [PATCH] backends: Do not perform field deletion for new tasks --- tasklib/backends.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasklib/backends.py b/tasklib/backends.py index 6e7d918..fd3069c 100644 --- a/tasklib/backends.py +++ b/tasklib/backends.py @@ -171,11 +171,17 @@ class TaskWarrior(Backend): if task.saved: for field in task._modified_fields: add_field(field) + # For new tasks, pass all fields that make sense else: for field in task._data.keys(): + # We cannot set stuff that's read only (ID, UUID, ..) if field in task.read_only_fields: continue + # We do not want to do field deletion for new tasks + if task._data[field] is None: + continue + # Otherwise we're fine add_field(field) return args -- 2.39.5