some py3 fixes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user