From 6057ad0e915e54515e90563a61416b43225a3c74 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Mon, 29 Jun 2009 13:52:51 +0000 Subject: [PATCH] check if the comment is not already published, before publishing. svn path=/plone.app.discussion/trunk/; revision=27723 --- plone/app/discussion/browser/moderation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plone/app/discussion/browser/moderation.py b/plone/app/discussion/browser/moderation.py index a2a1e5a..b12e348 100644 --- a/plone/app/discussion/browser/moderation.py +++ b/plone/app/discussion/browser/moderation.py @@ -147,7 +147,9 @@ class BulkActionsView(BrowserView): for path in self.paths: comment = context.restrictedTraverse(path) portal_workflow = getToolByName(comment, 'portal_workflow') - portal_workflow.doActionFor(comment, 'publish') + current_state = portal_workflow.getInfoFor(comment, 'review_state') + if current_state != 'published': + portal_workflow.doActionFor(comment, 'publish') catalog = getToolByName(comment, 'portal_catalog') catalog.reindexObject(comment)