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 | ## |
---|
10 | from Products.qPloneComments.utils import manage_mails |
---|
11 | if obj is None: |
---|
12 | obj=context |
---|
13 | |
---|
14 | parent = obj.inReplyTo() |
---|
15 | if parent is not None: |
---|
16 | talkback = context.portal_discussion.getDiscussionFor(parent) |
---|
17 | else: |
---|
18 | talkback = parent = obj.aq_parent |
---|
19 | |
---|
20 | talkback.deleteReply( obj.getId() ) |
---|
21 | manage_mails(obj, context, 'deleting') |
---|
22 | |
---|
23 | view = parent.getTypeInfo().getActionById('view') |
---|
24 | context.REQUEST['RESPONSE'].redirect( parent.absolute_url() |
---|
25 | + '/%s?portal_status_message=Reply+deleted' % view ) |
---|
Note: See
TracBrowser
for help on using the repository browser.