source: WAeUP_SRP/trunk/skins/waeup_student/delete_course_result.py @ 1575

Last change on this file since 1575 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"""
12FIXME: add docstring.
13"""
14
15from Products.CMFCore.utils import getToolByName
16here = context
17
18import logging
19logger = logging.getLogger('Skins.delete_course_result')
20mtool = context.portal_membership
21member = mtool.getAuthenticatedMember()
22
23ret_url = here.absolute_url()
24
25message = ''
26if 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'
35else:
36    message = 'portal_status_message=psm_select_at_least_one_document'
37
38if REQUEST is not None:
39    return REQUEST.RESPONSE.redirect(ret_url + '?' + message)
Note: See TracBrowser for help on using the repository browser.