[Erp5-report] r35340 nicolas - /erp5/trunk/products/ERP5/mixin/cached_convertable.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri May 14 14:39:53 CEST 2010


Author: nicolas
Date: Fri May 14 14:39:48 2010
New Revision: 35340

URL: http://svn.erp5.org?rev=35340&view=rev
Log:
Backward compatibility:
 * if cached value is a tuple as it was before refactoring
   http://svn.erp5.org?rev=35216&view=rev
   raise a KeyError to invalidate this cache entry and force
   calculation of a new conversion

Modified:
    erp5/trunk/products/ERP5/mixin/cached_convertable.py

Modified: erp5/trunk/products/ERP5/mixin/cached_convertable.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/mixin/cached_convertable.py?rev=35340&r1=35339&r2=35340&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/mixin/cached_convertable.py [utf8] (original)
+++ erp5/trunk/products/ERP5/mixin/cached_convertable.py [utf8] Fri May 14 14:39:48 2010
@@ -181,6 +181,14 @@
       if cache_entry is not None:
         data_dict = cache_entry.getValue()
         if data_dict:
+          if isinstance(data_dict, tuple):
+            # Backward compatibility: if cached value is a tuple
+            # as it was before refactoring
+            # http://svn.erp5.org?rev=35216&view=rev
+            # raise a KeyError to invalidate this cache entry and force
+            # calculation of a new conversion
+            raise KeyError('Old cache conversion format,'\
+                               'cache entry invalidated for key:%r' % cache_id)
           content_md5 = data_dict['content_md5']
           if content_md5 != self.getContentMd5():
             raise KeyError, 'Conversion cache key is compromised for %r' % cache_id




More information about the Erp5-report mailing list