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