ee1b27296df1c4dc0e031381cdfd8227c13b0336
1 ## Script (Python) "discussionItemDelete"
2 ##title=Add item to favourites
4 from Products
.CMFCore
.utils
import getToolByName
5 disTool
= getToolByName(context
, 'portal_discussion')
6 thread
= context
.parentsInThread()
8 talk
= disTool
.getDiscussionFor(context
)
10 if talk
.hasReplies(context
) :
11 context
.setStatus(True, 'Discussion thread deleted.')
14 context
.setStatus(True, 'Comment deleted.')
16 context
.setStatus(True, 'Reply deleted.')
19 talk
.deleteReply(context
.id)
21 return context
.setRedirect(content
, 'object/view', **context
.REQUEST
.form
)