[Erp5-report] r14625 - /erp5/trunk/products/ERP5/Document/Document.py

nobody at svn.erp5.org nobody at svn.erp5.org
Sat May 26 14:39:18 CEST 2007


Author: bartek
Date: Sat May 26 14:39:18 2007
New Revision: 14625

URL: http://svn.erp5.org?rev=14625&view=rev
Log:
don't try to generate html preview if the doc has no data; updated a comment (the 'do until content' is not there anymore')

Modified:
    erp5/trunk/products/ERP5/Document/Document.py

Modified: erp5/trunk/products/ERP5/Document/Document.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Document.py?rev=14625&r1=14624&r2=14625&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Document.py (original)
+++ erp5/trunk/products/ERP5/Document/Document.py Sat May 26 14:39:18 2007
@@ -965,7 +965,7 @@
         fallback_script_id = 'Document_getPreferredDocumentMetadataDiscoveryOrderList')
     order_list = list(method())
     order_list.reverse()
-    # Start with everything until content - build a dictionary according to the order
+    # build a dictionary according to the order
     kw = {}
     for order_id in order_list:
       result = None
@@ -1071,6 +1071,8 @@
       A private method which converts to HTML. This method
       is the one to override in subclasses.
     """
+    if not self.getData():
+      return ''
     if self.hasConversion(format='base-html'):
       mime, data = self.getConversion(format='base-html')
       return data
@@ -1084,6 +1086,8 @@
       (without html and body tags, etc.) which can be used to inline
       a preview of the document.
     """
+    if not self.getData():
+      return ''
     if self.hasConversion(format='stripped-html'): # XXX this is redundant since we never set it
       mime, data = self.getConversion(format='stripped-html')
       return data




More information about the Erp5-report mailing list