merge r34694-r34695 from the jarn-1.0b3 branch.

Fix unicode error when non-ASCII characters are typed into the name field of a comment by anonymous users. 
We are indexing the member.id only now instead of the full member name or what anonymous users typed into the name field.

svn path=/plone.app.discussion/trunk/; revision=34932
This commit is contained in:
Timo Stollenwerk
2010-03-16 13:06:08 +00:00
parent 6e226be248
commit 819b66e149
3 changed files with 11 additions and 10 deletions
+4 -8
View File
@@ -142,22 +142,18 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
portal_membership = getToolByName(self.context, 'portal_membership')
if portal_membership.isAnonymousUser():
comment.creator = author_name
comment.creator = None
comment.author_name = author_name
comment.author_email = author_email
comment.author_notification = author_notification
#comment.author_notification = author_notification
comment.creation_date = comment.modification_date = datetime.now()
else:
member = portal_membership.getAuthenticatedMember()
fullname = member.getProperty('fullname')
if fullname == '' or None:
comment.creator = member.id
else:
comment.creator = fullname
comment.creator = member.id
comment.author_username = member.getUserName()
comment.author_name = member.getProperty('fullname')
comment.author_email = member.getProperty('email')
comment.author_notification = comment.author_notification
#comment.author_notification = comment.author_notification
comment.creation_date = comment.modification_date = datetime.now()
# Check if the added comment is a reply to an existing comment