From f1e333d4f57aad9f5b086518c6816d9b3d07bd98 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Thu, 2 Nov 2006 17:24:06 +0000
Subject: [PATCH] Cache was almost not working because the global variable was
 not used

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11077 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Cache.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/product/ERP5Type/Cache.py b/product/ERP5Type/Cache.py
index 9b45f2a216..07b4edb953 100644
--- a/product/ERP5Type/Cache.py
+++ b/product/ERP5Type/Cache.py
@@ -180,7 +180,9 @@ class CachingMethod:
     try:
       ## try to get value from cache in a try block 
       ## which is faster than checking for keys
-      value = self.factories[self.cache_factory](self.callable_object, 
+      # It is very important to take the factories dictionnary
+      # on CachingMethod instead of self, we want a global variable
+      value = CachingMethod.factories[self.cache_factory](self.callable_object, 
                                                                cache_id,
                                                                scope, 
                                                                self.cache_duration, 
-- 
2.30.9