Refactor the comment creator/author_name to comply with the Plone core convention to store the username on the creator attribute and not the fullname.
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
border="0"
|
||||
height="32"
|
||||
tal:attributes="src portrait_url;
|
||||
alt reply/Creator" />
|
||||
alt reply/author_name" />
|
||||
</a>
|
||||
<img src="defaultUser.gif"
|
||||
alt=""
|
||||
@@ -56,20 +56,20 @@
|
||||
height="32"
|
||||
tal:condition="not: has_author_link"
|
||||
tal:attributes="src portrait_url;
|
||||
alt reply/Creator" />
|
||||
alt reply/author_name" />
|
||||
</div>
|
||||
|
||||
<div class="documentByLine" i18n:domain="plone.app.discussion">
|
||||
<tal:name>
|
||||
<a href=""
|
||||
tal:condition="has_author_link"
|
||||
tal:content="reply/Creator"
|
||||
tal:content="reply/author_name"
|
||||
tal:attributes="href author_home_url">
|
||||
Poster Name
|
||||
</a>
|
||||
<span tal:condition="not: has_author_link"
|
||||
tal:replace="reply/Creator" />
|
||||
<span tal:condition="not: reply/Creator">Anonymous</span>
|
||||
tal:replace="reply/author_name" />
|
||||
<span tal:condition="not: reply/author_name">Anonymous</span>
|
||||
</tal:name>
|
||||
<tal:posted i18n:translate="label_says">says:</tal:posted>
|
||||
<div class="commentDate"
|
||||
|
||||
@@ -179,7 +179,6 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
|
||||
if portal_membership.isAnonymousUser() and \
|
||||
settings.anonymous_comments:
|
||||
# Anonymous Users
|
||||
comment.creator = author_name
|
||||
comment.author_name = author_name
|
||||
comment.author_email = author_email
|
||||
comment.user_notification = user_notification
|
||||
@@ -198,7 +197,7 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
|
||||
fullname = unicode(fullname, 'utf-8')
|
||||
if email and isinstance(email, str):
|
||||
email = unicode(email, 'utf-8')
|
||||
comment.creator = fullname
|
||||
comment.creator = username
|
||||
comment.author_username = username
|
||||
comment.author_name = fullname
|
||||
comment.author_email = email
|
||||
|
||||
Reference in New Issue
Block a user