From ebb39b499400303f54411c40fafc807074edc383 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Mon, 19 Mar 2012 16:32:33 +0100 Subject: [PATCH] No need to define portal_membership tool twice. --- plone/app/discussion/browser/comments.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plone/app/discussion/browser/comments.py b/plone/app/discussion/browser/comments.py index 28d4d44..cae1887 100644 --- a/plone/app/discussion/browser/comments.py +++ b/plone/app/discussion/browser/comments.py @@ -96,8 +96,8 @@ class CommentForm(extensible.ExtensibleForm, form.Form): self.widgets['user_notification'].label = _(u"") # Anonymous / Logged-in - portal_membership = getToolByName(self.context, 'portal_membership') - if not portal_membership.isAnonymousUser(): + mtool = getToolByName(self.context, 'portal_membership') + if not mtool.isAnonymousUser(): self.widgets['author_name'].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) settings = registry.forInterface(IDiscussionSettings, check=False) - mtool = getToolByName(self.context, 'portal_membership') member = mtool.getAuthenticatedMember() member_email = member.getProperty('email')