Commit 045bc4b6 authored by Nicolas Delaby's avatar Nicolas Delaby

Remove statement condition, content will never be equal to None

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29025 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f0b20cfc
...@@ -316,21 +316,17 @@ class Image(File, OFSImage): ...@@ -316,21 +316,17 @@ class Image(File, OFSImage):
mime_type = str(mime_type) mime_type = str(mime_type)
src_mimetype = self.getContentType() src_mimetype = self.getContentType()
content = '%s' % self.getData() content = '%s' % self.getData()
if content is not None: portal_transforms = getToolByName(self, 'portal_transforms')
portal_transforms = getToolByName(self, 'portal_transforms') result = portal_transforms.convertToData(mime_type, content,
result = portal_transforms.convertToData(mime_type, content, object=self, context=self,
object=self, context=self, filename=self.getTitleOrId(),
filename=self.getTitleOrId(), mimetype=src_mimetype)
mimetype=src_mimetype) if result is None:
if result is None: # portal_transforms fails to convert.
# portal_transforms fails to convert. LOG('TextDocument.convert', WARNING,
LOG('TextDocument.convert', WARNING, 'portal_transforms failed to convert to %s: %r' % (mime_type, self))
'portal_transforms failed to convert to %s: %r' % (mime_type, self)) result = ''
result = '' return mime_type, result
return mime_type, result
else:
# text_content is not set, return empty string instead of None
return mime_type, ''
# Conversion API # Conversion API
security.declareProtected(Permissions.ModifyPortalContent, 'convert') security.declareProtected(Permissions.ModifyPortalContent, 'convert')
......
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