Check the review_state instead of the workflow after a comment has been posted to decide if a message is shown to the user. This allows integrators to use custom review workflows. Refs #11184

svn path=/plone.app.discussion/trunk/; revision=40566
This commit is contained in:
Timo Stollenwerk 2010-10-08 09:53:00 +00:00
parent aea10731cd
commit 2790e6d4eb
2 changed files with 9 additions and 6 deletions

View File

@ -4,7 +4,10 @@ Changelog
1.0b10 (unreleased)
-------------------
- Nothing changed yet.
- Check the review_state instead of the workflow after a comment has been
posted to decide if a message is shown to the user. This allows integrators
to use custom review workflows.
[timo]
1.0b9 (2010-10-07)

View File

@ -191,13 +191,13 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
# Add a comment to the conversation
comment_id = conversation.addComment(comment)
# If a user post a comment and moderation is enabled, a message is shown
# to the user that his/her comment awaits moderation. If the user has
# manage right, he/she is redirected directly to the comment.
# If a user posts a comment and moderation is enabled, a message is
# shown to the user that his/her comment awaits moderation. If the user
# has manage right, he/she is redirected directly to the comment.
can_manage = getSecurityManager().checkPermission('Manage portal',
context)
if wf.getChainForPortalType('Discussion Item') == \
('comment_review_workflow',) and not can_manage:
comment_review_state = wf.getInfoFor(comment, 'review_state')
if comment_review_state == 'pending' and not can_manage:
# Show info message when comment moderation is enabled
IStatusMessage(self.context.REQUEST).addStatusMessage(
_("Your comment awaits moderator approval."),