From 0110af91cb5bf3804efc35cb50c8430419af4313 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sat, 7 Feb 2015 12:35:31 +0100 Subject: [PATCH] SerializingObject: Make sure UUID is properly validated --- tasklib/task.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tasklib/task.py b/tasklib/task.py index 51c97d3..138ea7c 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -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): -- 2.39.5