Use safe_unicode to decode the title of the content. encode("utf-9") caused Dexterity based content types to raise a unicode decode error. This fixes http://dev.plone.org/plone/ticket/11292. Refs #11292

svn path=/plone.app.discussion/trunk/; revision=45915
This commit is contained in:
Timo Stollenwerk
2010-11-23 14:03:47 +00:00
parent 3c219397fa
commit 7dbcc9e2be
2 changed files with 9 additions and 1 deletions
+3 -1
View File
@@ -27,6 +27,8 @@ from persistent import Persistent
from Products.CMFCore.DynamicType import DynamicType
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.utils import safe_unicode
from OFS.Traversable import Traversable
from plone.registry.interfaces import IRegistry
@@ -137,7 +139,7 @@ class Comment(CatalogAware, WorkflowAware, DynamicType, Traversable,
title = translate(
Message(COMMENT_TITLE,
mapping={'creator': creator,
'content': content.Title().decode("utf-8")}))
'content': safe_unicode(content.Title())}))
return title
def Creator(self):