From 819b66e1493fc032b3e6ba536b8d2821272d20f0 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Tue, 16 Mar 2010 13:06:08 +0000 Subject: [PATCH] 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 --- CHANGES.txt | 5 +++++ plone/app/discussion/browser/comments.pt | 4 ++-- plone/app/discussion/browser/comments.py | 12 ++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 9c201cb..4960a23 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,10 @@ Changelog 1.0b4 (unreleased) ------------------ +* Fix unicode error when non-ASCII characters are typed into the name field of a + comment by anonymous users. + [regebro] + * New feature: As a moderator, I am notified when new comments require my attention. [timo] @@ -17,6 +21,7 @@ Changelog * Added greek translation. [ggozad] + 1.0b3 (2010-01-28) ------------------ diff --git a/plone/app/discussion/browser/comments.pt b/plone/app/discussion/browser/comments.pt index 974d8e8..8f6c180 100644 --- a/plone/app/discussion/browser/comments.pt +++ b/plone/app/discussion/browser/comments.pt @@ -74,8 +74,8 @@ - Anonymous User + Anonymous User at 8/23/2001 12:40:44 PM diff --git a/plone/app/discussion/browser/comments.py b/plone/app/discussion/browser/comments.py index 5e25941..d2cabb6 100644 --- a/plone/app/discussion/browser/comments.py +++ b/plone/app/discussion/browser/comments.py @@ -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