From 92e0ed0f1fdf6ac1f69c8b30e18a503022f57c9f Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Mon, 21 Dec 2015 01:57:21 +0100 Subject: [PATCH] SerializingObject: Perform more efficient deserialization of dependencies --- tasklib/serializing.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasklib/serializing.py b/tasklib/serializing.py index 767f7df..a9b33ee 100644 --- a/tasklib/serializing.py +++ b/tasklib/serializing.py @@ -186,6 +186,9 @@ class SerializingObject(object): def deserialize_depends(self, raw_uuids): raw_uuids = raw_uuids or [] # Convert None to empty list + if not raw_uuids: + return set() + # TW 2.4.4 encodes list of dependencies as a single string if type(raw_uuids) is not list: uuids = raw_uuids.split(',') @@ -193,7 +196,7 @@ class SerializingObject(object): else: uuids = raw_uuids - return set(self.backend.tasks.get(uuid=uuid) for uuid in uuids if uuid) + return set(self.backend.tasks.filter(' '.join(uuids))) def datetime_normalizer(self, value): """ -- 2.39.5