check if the comment is not already published, before publishing.
svn path=/plone.app.discussion/trunk/; revision=27723
This commit is contained in:
		
							parent
							
								
									7e3de6ae0a
								
							
						
					
					
						commit
						6057ad0e91
					
				@ -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)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user