Many updates to handle non public comments properly

This commit is contained in:
Patrick Gerken
2013-03-28 14:28:22 +01:00
parent 6320048b37
commit 05f0e7e4d8
8 changed files with 87 additions and 13 deletions
+6 -2
View File
@@ -95,6 +95,7 @@ class DeleteComment(BrowserView):
conversation = aq_parent(comment)
content_object = aq_parent(conversation)
del conversation[comment.id]
content_object.reindexObject()
IStatusMessage(self.context.REQUEST).addStatusMessage(
_("Comment deleted."),
type="info")
@@ -201,12 +202,13 @@ class BulkActionsView(BrowserView):
context = aq_inner(self.context)
for path in self.paths:
comment = context.restrictedTraverse(path)
content_object = aq_parent(aq_parent(comment))
workflowTool = getToolByName(comment, 'portal_workflow')
current_state = workflowTool.getInfoFor(comment, 'review_state')
if current_state != 'published':
workflowTool.doActionFor(comment, 'publish')
catalog = getToolByName(comment, 'portal_catalog')
catalog.reindexObject(comment)
comment.reindexObject()
content_object.reindexObject()
def mark_as_spam(self):
raise NotImplementedError
@@ -223,4 +225,6 @@ class BulkActionsView(BrowserView):
for path in self.paths:
comment = context.restrictedTraverse(path)
conversation = aq_parent(comment)
content_object = aq_parent(conversation)
del conversation[comment.id]
content_object.reindexObject()