Commit e217698e authored by Nicolas Delaby's avatar Nicolas Delaby

Add missing cached_mime, replace hasattr by getattr

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20369 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cf48e107
......@@ -136,16 +136,19 @@ class ConversionCacheMixin:
self._cached_time = PersistentMapping()
self._cached_data = PersistentMapping()
self._cached_size = PersistentMapping()
self._cached_mime = PersistentMapping()
security.declareProtected(Permissions.View, 'updateConversionCache')
def updateConversionCache(self):
aself = aq_base(self)
if not hasattr(aself, '_cached_time') or self._cached_time is None:
if getattr(aself, '_cached_time', None) is None or self._cached_time is None:
self._cached_time = PersistentMapping()
if not hasattr(aself, '_cached_data') or self._cached_data is None:
if getattr(aself, '_cached_data', None) is None or self._cached_data is None:
self._cached_data = PersistentMapping()
if not hasattr(aself, '_cached_size') or self._cached_size is None:
if getattr(aself, '_cached_size', None) is None or self._cached_size is None:
self._cached_size = PersistentMapping()
if getattr(aself, '_cached_mime', None) is None or self._cached_mime is None:
self._cached_mime = PersistentMapping()
security.declareProtected(Permissions.View, 'hasConversion')
def hasConversion(self, **format):
......
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