Commit 933ca5f8 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fix a bug introduced in r28375.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28381 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b2e63011
...@@ -102,16 +102,18 @@ class PDFDocument(Image, ConversionCacheMixin): ...@@ -102,16 +102,18 @@ class PDFDocument(Image, ConversionCacheMixin):
try: try:
return self.getConversion(format=format) return self.getConversion(format=format)
except KeyError: except KeyError:
mime = 'text/html'
data = self._convertToHTML() data = self._convertToHTML()
self.setConversion(data, mime='text/html', format=format) self.setConversion(data, mime=mime, format=format)
return (mime, aq_base(data)) return (mime, data)
elif format in ('txt', 'text'): elif format in ('txt', 'text'):
try: try:
return self.getConversion(format='txt') return self.getConversion(format='txt')
except KeyError: except KeyError:
mime = 'text/plain'
data = self._convertToText() data = self._convertToText()
self.setConversion(data, mime='text/plain', format='txt') self.setConversion(data, mime=mime, format='txt')
return (mime, aq_base(data)) return (mime, data)
else: else:
return Image.convert(self, format, **kw) return Image.convert(self, format, **kw)
......
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