Back to index

plone3  3.1.7
discitem_delete.py
Go to the documentation of this file.
00001 ##parameters=
00002 ##title=Delete reply
00003 ##
00004 from Products.CMFCore.utils import getUtilityByInterfaceName
00005 from Products.CMFDefault.utils import Message as _
00006 
00007 dtool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IDiscussionTool')
00008 
00009 parent = context.inReplyTo()
00010 talkback = dtool.getDiscussionFor(parent)
00011 talkback.deleteReply( context.getId() )
00012 
00013 context.setStatus(True, _(u'Reply deleted.'))
00014 context.setRedirect(parent, 'object/view')