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:
parent
2e1cda3f59
commit
1670338ace
@ -17,7 +17,7 @@ plone.app.discussion to-do
|
|||||||
|
|
||||||
[ ] Add i18n translations
|
[ ] 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
|
[ ] Plone reports "unsuccessfully attempted to uncatalog an object" while
|
||||||
trying to delete a comment.
|
trying to delete a comment.
|
||||||
|
@ -158,7 +158,11 @@ class AddComment(BrowserView):
|
|||||||
comment.creation_date = comment.modification_date = datetime.now()
|
comment.creation_date = comment.modification_date = datetime.now()
|
||||||
else:
|
else:
|
||||||
member = portal_membership.getAuthenticatedMember()
|
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_username = member.getUserName()
|
||||||
comment.author_name = member.getProperty('fullname')
|
comment.author_name = member.getProperty('fullname')
|
||||||
comment.author_email = member.getProperty('email')
|
comment.author_email = member.getProperty('email')
|
||||||
|
Loading…
Reference in New Issue
Block a user