## Script (Python) "reject_courses" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=REQUEST, student=None ##title= ## # $Id: getStudyCourseInfo.py 1504 2007-02-26 21:20:40Z henrik $ """ close the Students StudyLevel """ try: from Products.zdb import set_trace except: def set_trace(): pass from urllib import urlencode request = context.REQUEST mtool = context.portal_membership member = mtool.getAuthenticatedMember() member_id = str(member) import logging logger = logging.getLogger('Skins.reject_courses') wftool = context.portal_workflow wftool.doActionFor(context,'open') wftool.doActionFor(context,'close_for_edit') students_folder = context.portal_url.getPortalObject().campus.students student = getattr(students_folder,context.getStudentId()) wftool.doActionFor(student,'reject_courses') logger.info('%s rejected course list of %s' % (member,student.getId())) args = {} action = "/contact_student_form_2" psm = "Student's course list has been rejected! Please fill and submit the form below!" subject = "Course list rejected" args['subject'] = subject args['continue'] = 'study_level_view' args['portal_status_message'] = psm url = context.absolute_url() + action + '?' + urlencode(args) return REQUEST.RESPONSE.redirect(url) #return request.RESPONSE.redirect("%s" % context.absolute_url())