Do not raise an error when no workflow is assigned to the comment type.

This commit is contained in:
Timo Stollenwerk 2013-03-27 17:06:14 +01:00
parent 317bbca6d8
commit 0c6b873bef

View File

@ -233,7 +233,11 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
can_review = getSecurityManager().checkPermission('Review comments',
context)
workflowTool = getToolByName(context, 'portal_workflow')
comment_review_state = workflowTool.getInfoFor(comment, 'review_state')
comment_review_state = workflowTool.getInfoFor(
comment,
'review_state',
None
)
if comment_review_state == 'pending' and not can_review:
# Show info message when comment moderation is enabled
IStatusMessage(self.context.REQUEST).addStatusMessage(