Commit 3615d6b5 authored by Nicolas Delaby's avatar Nicolas Delaby

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


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35340 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 95473103
......@@ -181,6 +181,14 @@ class CachedConvertableMixin:
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment