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,6 +147,8 @@ class BulkActionsView(BrowserView):
for path in self.paths: for path in self.paths:
comment = context.restrictedTraverse(path) comment = context.restrictedTraverse(path)
portal_workflow = getToolByName(comment, 'portal_workflow') portal_workflow = getToolByName(comment, 'portal_workflow')
current_state = portal_workflow.getInfoFor(comment, 'review_state')
if current_state != 'published':
portal_workflow.doActionFor(comment, 'publish') portal_workflow.doActionFor(comment, 'publish')
catalog = getToolByName(comment, 'portal_catalog') catalog = getToolByName(comment, 'portal_catalog')
catalog.reindexObject(comment) catalog.reindexObject(comment)