Do not render/update the comment form in CommentViewlets if commenting is disabled, since this slows down the page rendering. This fixes http://dev.plone.org/plone/ticket/11930 #11930

svn path=/plone.app.discussion/trunk/; revision=50489
This commit is contained in:
Timo Stollenwerk 2011-06-16 10:59:25 +00:00
parent 5fc9854d36
commit 98bcc19d5c
2 changed files with 12 additions and 4 deletions

View File

@ -14,6 +14,11 @@ Changelog
Related to https://dev.plone.org/plone/ticket/11737
[WouterVH]
- Do not render/update the comment form in CommentViewlets if commenting is
disabled, since this slows down the page rendering. This fixes
http://dev.plone.org/plone/ticket/11930
[fafhrd]
2.0.4 (2011-05-28)
------------------

View File

@ -248,6 +248,9 @@ class CommentsViewlet(ViewletBase):
def update(self):
super(CommentsViewlet, self).update()
if self.is_discussion_allowed() and \
(self.is_anonymous() and self.anonymous_discussion_allowed() \
or self.can_reply()):
z2.switch_on(self, request_layer=IFormLayer)
self.form = self.form(aq_inner(self.context), self.request)
alsoProvides(self.form, IWrappedForm)