## Script (Python) "delete_course_result" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=ids=[], REQUEST=None ##title= ## # $Id: delete_course_result.py 1557 2007-03-15 16:00:27Z joachim $ """ FIXME: add docstring. """ from Products.CMFCore.utils import getToolByName here = context import logging logger = logging.getLogger('Skins.delete_course_result') mtool = context.portal_membership member = mtool.getAuthenticatedMember() ret_url = here.absolute_url() message = '' if ids: real_ids = [] for id in ids: if context.hasObject(id): real_ids.append(id) if real_ids: context.manage_delObjects(real_ids) logger.info('%s deleted StudentCourseResult object %s' % (member,id)) message = 'portal_status_message=psm_item(s)_deleted' else: message = 'portal_status_message=psm_select_at_least_one_document' if REQUEST is not None: return REQUEST.RESPONSE.redirect(ret_url + '?' + message)