]> 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:

Set missing attributes back to Task._data on access
authorRob Golding <rob@robgolding.com>
Fri, 9 Jan 2015 12:37:51 +0000 (12:37 +0000)
committerRob Golding <rob@robgolding.com>
Fri, 9 Jan 2015 12:37:51 +0000 (12:37 +0000)
Allows appending/adding to empty lists/sets

tasklib/task.py

index d5913af9adda62e66f05bb7931410c94a0000f37..a739d25b46e2ebcc6137a7300fcb7bd1bc2618a9 100644 (file)
@@ -126,7 +126,10 @@ class TaskResource(SerializingObject):
         except ValueError:
             pass
 
-        return self._data.get(key) or self._deserialize(key, None)
+        if key not in self._data:
+            self._data[key] = self._deserialize(key, None)
+
+        return self._data.get(key)
 
     def __setitem__(self, key, value):
         if key in self.read_only_fields: