Commit 684215ff authored by Bartek Górny's avatar Bartek Górny

better way to check if there are data (more generic) - correction of previous commit

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14627 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 135410e7
...@@ -1071,7 +1071,7 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin): ...@@ -1071,7 +1071,7 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin):
A private method which converts to HTML. This method A private method which converts to HTML. This method
is the one to override in subclasses. is the one to override in subclasses.
""" """
if not self.getData(): if not self.hasBaseData():
return '' return ''
if self.hasConversion(format='base-html'): if self.hasConversion(format='base-html'):
mime, data = self.getConversion(format='base-html') mime, data = self.getConversion(format='base-html')
...@@ -1086,7 +1086,7 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin): ...@@ -1086,7 +1086,7 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin):
(without html and body tags, etc.) which can be used to inline (without html and body tags, etc.) which can be used to inline
a preview of the document. a preview of the document.
""" """
if not self.getData(): if not self.hasBaseData():
return '' return ''
if self.hasConversion(format='stripped-html'): # XXX this is redundant since we never set it if self.hasConversion(format='stripped-html'): # XXX this is redundant since we never set it
mime, data = self.getConversion(format='stripped-html') mime, data = self.getConversion(format='stripped-html')
......
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