Do not raise an error when no workflow is assigned to the comment type.
This commit is contained in:
parent
317bbca6d8
commit
0c6b873bef
@ -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(
|
||||||
|
Loading…
Reference in New Issue
Block a user