fix commenting in py3

This commit is contained in:
Philip Bauer
2018-09-18 15:13:38 +02:00
parent a7d95a9449
commit a8f2db58ff
3 changed files with 15 additions and 9 deletions
+7 -1
View File
@@ -13,6 +13,7 @@ from Products.CMFCore.interfaces import IContentish
from Products.CMFPlone.utils import safe_unicode
from Products.ZCatalog.interfaces import IZCatalog
import six
MAX_DESCRIPTION = 25
@@ -70,7 +71,12 @@ def title(object):
@indexer(IComment)
def creator(object):
return object.creator and safe_unicode(object.creator).encode('utf-8')
if not object.creator:
return
value = safe_unicode(object.creator)
if six.PY2:
return value.encode('utf8')
return value
@indexer(IComment)