No need to define portal_membership tool twice.
This commit is contained in:
parent
58663fb492
commit
ebb39b4994
@ -96,8 +96,8 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
|
|||||||
self.widgets['user_notification'].label = _(u"")
|
self.widgets['user_notification'].label = _(u"")
|
||||||
|
|
||||||
# Anonymous / Logged-in
|
# Anonymous / Logged-in
|
||||||
portal_membership = getToolByName(self.context, 'portal_membership')
|
mtool = getToolByName(self.context, 'portal_membership')
|
||||||
if not portal_membership.isAnonymousUser():
|
if not mtool.isAnonymousUser():
|
||||||
self.widgets['author_name'].mode = interfaces.HIDDEN_MODE
|
self.widgets['author_name'].mode = interfaces.HIDDEN_MODE
|
||||||
self.widgets['author_email'].mode = interfaces.HIDDEN_MODE
|
self.widgets['author_email'].mode = interfaces.HIDDEN_MODE
|
||||||
|
|
||||||
@ -108,7 +108,6 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
|
|||||||
|
|
||||||
registry = queryUtility(IRegistry)
|
registry = queryUtility(IRegistry)
|
||||||
settings = registry.forInterface(IDiscussionSettings, check=False)
|
settings = registry.forInterface(IDiscussionSettings, check=False)
|
||||||
mtool = getToolByName(self.context, 'portal_membership')
|
|
||||||
member = mtool.getAuthenticatedMember()
|
member = mtool.getAuthenticatedMember()
|
||||||
member_email = member.getProperty('email')
|
member_email = member.getProperty('email')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user