Add id fall back for Creator if no Username (Title) has been added.

svn path=/plone.app.discussion/trunk/; revision=27417
This commit is contained in:
Timo Stollenwerk 2009-06-14 08:45:17 +00:00
parent 2e1cda3f59
commit 1670338ace
2 changed files with 6 additions and 2 deletions

View File

@ -17,7 +17,7 @@ plone.app.discussion to-do
[ ] Add i18n translations
[ ] Add id fall back for Creator if no Username (Title) has been added
[X] Add id fall back for Creator if no Username (Title) has been added
[ ] Plone reports "unsuccessfully attempted to uncatalog an object" while
trying to delete a comment.

View File

@ -158,7 +158,11 @@ class AddComment(BrowserView):
comment.creation_date = comment.modification_date = datetime.now()
else:
member = portal_membership.getAuthenticatedMember()
comment.creator = member.getProperty('fullname')
fullname = member.getProperty('fullname')
if fullname == '' or None:
comment.creator = member.id
else:
comment.creator = fullname
comment.author_username = member.getUserName()
comment.author_name = member.getProperty('fullname')
comment.author_email = member.getProperty('email')