Last change
on this file since 1589 was
1571,
checked in by Henrik Bettermann, 18 years ago
|
new logging format Part 4 (rest)
|
File size:
1.0 KB
|
Line | |
---|
1 | ## Script (Python) "delete_course_result" |
---|
2 | ##bind container=container |
---|
3 | ##bind context=context |
---|
4 | ##bind namespace= |
---|
5 | ##bind script=script |
---|
6 | ##bind subpath=traverse_subpath |
---|
7 | ##parameters=ids=[], REQUEST=None |
---|
8 | ##title= |
---|
9 | ## |
---|
10 | # $Id: delete_course_result.py 1557 2007-03-15 16:00:27Z joachim $ |
---|
11 | """ |
---|
12 | FIXME: add docstring. |
---|
13 | """ |
---|
14 | |
---|
15 | from Products.CMFCore.utils import getToolByName |
---|
16 | here = context |
---|
17 | |
---|
18 | import logging |
---|
19 | logger = logging.getLogger('Skins.delete_course_result') |
---|
20 | mtool = context.portal_membership |
---|
21 | member = mtool.getAuthenticatedMember() |
---|
22 | |
---|
23 | ret_url = here.absolute_url() |
---|
24 | |
---|
25 | message = '' |
---|
26 | if ids: |
---|
27 | real_ids = [] |
---|
28 | for id in ids: |
---|
29 | if context.hasObject(id): |
---|
30 | real_ids.append(id) |
---|
31 | if real_ids: |
---|
32 | context.manage_delObjects(real_ids) |
---|
33 | logger.info('%s deleted StudentCourseResult object %s' % (member,id)) |
---|
34 | message = 'portal_status_message=psm_item(s)_deleted' |
---|
35 | else: |
---|
36 | message = 'portal_status_message=psm_select_at_least_one_document' |
---|
37 | |
---|
38 | if REQUEST is not None: |
---|
39 | return REQUEST.RESPONSE.redirect(ret_url + '?' + message) |
---|
Note: See
TracBrowser for help on using the repository browser.