some py3 fixes

This commit is contained in:
Philip Bauer
2018-03-18 17:01:27 +01:00
parent ae71eab164
commit 71dcbf8465
4 changed files with 5 additions and 6 deletions
+1 -2
View File
@@ -12,7 +12,6 @@ from plone.uuid.interfaces import IUUID
from Products.CMFCore.interfaces import IContentish
from Products.CMFPlone.utils import safe_unicode
from Products.ZCatalog.interfaces import IZCatalog
from string import join
MAX_DESCRIPTION = 25
@@ -77,7 +76,7 @@ def creator(object):
@indexer(IComment)
def description(object):
# Return the first 25 words of the comment text and append ' [...]'
text = join(object.getText(targetMimetype='text/plain').split()[:MAX_DESCRIPTION])
text = ' '.join(object.getText(targetMimetype='text/plain').split()[:MAX_DESCRIPTION])
if len(object.getText().split()) > 25:
text += ' [...]'
return text