source: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/delete_course_result.py @ 5604

Last change on this file since 5604 was 1597, checked in by joachim, 18 years ago

merged changes 1588:1596 from trunk to joachim-event-branch

File size: 1.2 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, action_after_reject=None, action_after_validate=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
17from urllib import urlencode
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 = 'psm_item(s)_deleted'
35else:
36    message = 'psm_select_at_least_one_document'
37   
38args = {}
39args['portal_status_message'] = message
40url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
41if REQUEST is not None:
42    return REQUEST.RESPONSE.redirect(url)   
Note: See TracBrowser for help on using the repository browser.