check if the comment is not already published, before publishing.

svn path=/plone.app.discussion/trunk/; revision=27723
This commit is contained in:
Timo Stollenwerk 2009-06-29 13:52:51 +00:00
parent 7e3de6ae0a
commit 6057ad0e91

View File

@ -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)