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):
mime_type = str(mime_type)
src_mimetype = self.getContentType()
content = '%s' % self.getData()
if content is not None:
portal_transforms = getToolByName(self, 'portal_transforms')
result = portal_transforms.convertToData(mime_type, content,
object=self, context=self,
filename=self.getTitleOrId(),
mimetype=src_mimetype)
if result is None:
# portal_transforms fails to convert.
LOG('TextDocument.convert', WARNING,
'portal_transforms failed to convert to %s: %r' % (mime_type, self))
result = ''
return mime_type, result
else:
# text_content is not set, return empty string instead of None
return mime_type, ''
portal_transforms = getToolByName(self, 'portal_transforms')
result = portal_transforms.convertToData(mime_type, content,
object=self, context=self,
filename=self.getTitleOrId(),
mimetype=src_mimetype)
if result is None:
# portal_transforms fails to convert.
LOG('TextDocument.convert', WARNING,
'portal_transforms failed to convert to %s: %r' % (mime_type, self))
result = ''
return mime_type, result
# Conversion API
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