]> git.madduck.net Git - etc/taskwarrior.git/blobdiff - tasklib/backends.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

backends: Do not perform field deletion for new tasks
[etc/taskwarrior.git] / tasklib / backends.py
index 6e7d91815180d0f357bc3759ff867c6da7056615..fd3069c583aebc011222e28c096e3e38b026b502 100644 (file)
@@ -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