]> git.madduck.net Git - etc/taskwarrior.git/commitdiff

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:

Task: Add workaround for task bug in older versions, which eats up a part of description
authorTomas Babej <tomasbabej@gmail.com>
Thu, 25 Dec 2014 17:40:29 +0000 (18:40 +0100)
committerTomas Babej <tomasbabej@gmail.com>
Thu, 25 Dec 2014 22:51:11 +0000 (23:51 +0100)
tasklib/task.py

index 9eff14cedea2651dadae67cbea572306302aab0b..330491f65ed6ae4ee6e55db283f6379892e812c2 100644 (file)
@@ -228,16 +228,24 @@ class Task(TaskResource):
     def _get_modified_fields_as_args(self):
         args = []
 
     def _get_modified_fields_as_args(self):
         args = []
 
+        def add_field(field):
+            # Task version older than 2.4.0 ignores first word of the
+            # task description if description: prefix is used
+            if self.warrior.version < VERSION_2_4_0 and field == 'description':
+                args.append(self._data[field])
+            else:
+                args.append('{0}:{1}'.format(field, self._data[field]))
+
         # If we're modifying saved task, simply pass on all modified fields
         if self.saved:
             for field in self._modified_fields:
         # If we're modifying saved task, simply pass on all modified fields
         if self.saved:
             for field in self._modified_fields:
-                args.append('{0}:{1}'.format(field, self._data[field]))
+                add_field(field)
         # For new tasks, pass all fields that make sense
         else:
             for field in self._data.keys():
                 if field in self.read_only_fields:
                     continue
         # For new tasks, pass all fields that make sense
         else:
             for field in self._data.keys():
                 if field in self.read_only_fields:
                     continue
-                args.append('{0}:{1}'.format(field, self._data[field]))
+                add_field(field)
 
         return args
 
 
         return args