Commit ff18af4f authored by Nicolas Delaby's avatar Nicolas Delaby

Move in Try Except block the call of _convert.

All kind of exceptions raised explicitely by _convert are
catched, then in case of failure fallback to PermanentURLMixIn.




git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36241 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6e720b18
......@@ -470,14 +470,14 @@ class OOoDocument(PermanentURLMixIn, BaseConvertableFileMixin, File,
def _getExtensibleContent(self, request, name):
# Be sure that html conversion is done,
# as it is required to extract extensible content
try:
self._convert(format='html')
web_cache_kw = {'name': name,
'format': '_embedded'}
_setCacheHeaders(_ViewEmulator().__of__(self), web_cache_kw)
try:
mime, data = self.getConversion(format='_embedded', file_name=name)
return OFSFile(name, name, data, content_type=mime).__of__(self.aq_parent)
except KeyError:
except (NotConvertedError, ConversionError, KeyError):
return PermanentURLMixIn._getExtensibleContent(self, request, name)
security.declarePrivate('_convertToBaseFormat')
......
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