source: products/qPloneComments/branches/plone-2.5/skins/qplonecomments/2.0.5/deleteDiscussion.py

Last change on this file was 1, checked in by myroslav, 19 years ago

Building directory structure

  • Property svn:eol-style set to native
File size: 710 bytes
Line 
1## Script (Python) "deleteDiscussion"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=obj=None
8##title=Delete discussion item
9##
10from Products.qPloneComments.utils import manage_mails
11if obj is None:
12    obj=context
13
14parent = obj.inReplyTo()
15if parent is not None:
16    talkback = context.portal_discussion.getDiscussionFor(parent)
17else:
18    talkback = parent = obj.aq_parent
19
20talkback.deleteReply( obj.getId() )
21manage_mails(obj, context, 'deleting')
22
23view = parent.getTypeInfo().getActionById('view')
24context.REQUEST['RESPONSE'].redirect( parent.absolute_url()
25         + '/%s?portal_status_message=Reply+deleted' % view )
Note: See TracBrowser for help on using the repository browser.