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

SerializingObject: Make sure UUID is properly validated
authorTomas Babej <tomasbabej@gmail.com>
Sat, 7 Feb 2015 11:35:31 +0000 (12:35 +0100)
committerTomas Babej <tomasbabej@gmail.com>
Sat, 7 Feb 2015 11:35:31 +0000 (12:35 +0100)
tasklib/task.py

index 51c97d31736dc0a9e3d6aa631f940c3e6fae2344..138ea7c51d5a3c49db29611e8d71c01991fa95fb 100644 (file)
@@ -195,7 +195,13 @@ class SerializingObject(object):
             localized = value
         
         return localized
-            
+
+    def normalize_uuid(self, value):
+        # Enforce sane UUID
+        if not isinstance(value, six.text_type) or value == '':
+            raise ValueError("UUID must be a valid non-empty string.")
+
+        return value
 
 
 class TaskResource(SerializingObject):