Commit cc143300 authored by Fabien Morin's avatar Fabien Morin

getConversion return 2 values not only one

getConversion return a list of two values, so previous code ("return
len(self.getConversion(**kw))") always return 2.
Now the len of the data is returned.
In case of images, data is an OFSImage object. But OFSImage objects support
len, so it works also in case of images.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31542 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 84890560
......@@ -161,7 +161,8 @@ class CachedConvertableMixin:
"""
"""
try:
return len(self.getConversion(**kw))
mime, data = self.getConversion(**kw)
return len(data)
except KeyError:
return 0
......
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