From f4c62d864c32af08fcd4e359ffe3fbaf10d6a9bb Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Thu, 24 Dec 2015 13:35:47 +0100 Subject: [PATCH] LazyUUIDTaskSet: Do not replace when accessing __attributes --- tasklib/lazy.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tasklib/lazy.py b/tasklib/lazy.py index 0bd9332..0050547 100644 --- a/tasklib/lazy.py +++ b/tasklib/lazy.py @@ -66,8 +66,14 @@ class LazyUUIDTaskSet(object): def __getattr__(self, name): # Getattr is called only if the attribute could not be found using # normal means - self.replace() - return self.name + + if name.startswith('__'): + # If some internal method was being search, do not convert + # to TaskQuerySet just because of that + raise AttributeError + else: + self.replace() + return self.name def __eq__(self, other): return set(t['uuid'] for t in other) == self._uuids -- 2.39.2