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', can_review = getSecurityManager().checkPermission('Review comments',
context) context)
workflowTool = getToolByName(context, 'portal_workflow') 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: if comment_review_state == 'pending' and not can_review:
# Show info message when comment moderation is enabled # Show info message when comment moderation is enabled
IStatusMessage(self.context.REQUEST).addStatusMessage( IStatusMessage(self.context.REQUEST).addStatusMessage(