From 933ca5f8c11b9c78b44fcb63023e9a2127f52287 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Fri, 14 Aug 2009 09:44:57 +0000
Subject: [PATCH] fix a bug introduced in r28375.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28381 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/PDFDocument.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/product/ERP5/Document/PDFDocument.py b/product/ERP5/Document/PDFDocument.py
index da37f6fb58..685c35e438 100644
--- a/product/ERP5/Document/PDFDocument.py
+++ b/product/ERP5/Document/PDFDocument.py
@@ -102,16 +102,18 @@ class PDFDocument(Image, ConversionCacheMixin):
       try:
         return self.getConversion(format=format)
       except KeyError:
+        mime = 'text/html'
         data = self._convertToHTML()
-        self.setConversion(data, mime='text/html', format=format)
-        return (mime, aq_base(data))
+        self.setConversion(data, mime=mime, format=format)
+        return (mime, data)
     elif format in ('txt', 'text'):
       try:
         return self.getConversion(format='txt')
       except KeyError:
+        mime = 'text/plain'
         data = self._convertToText()
-        self.setConversion(data, mime='text/plain', format='txt')
-        return (mime, aq_base(data))
+        self.setConversion(data, mime=mime, format='txt')
+        return (mime, data)
     else:
       return Image.convert(self, format, **kw)
 
-- 
2.30.9