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

Last change on this file since 1575 was 1575, checked in by Henrik Bettermann, 18 years ago

ticket 106 and 124

File size: 1.4 KB
Line 
1## Script (Python) "reject_courses"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=REQUEST, student=None
8##title=
9##
10# $Id: getStudyCourseInfo.py 1504 2007-02-26 21:20:40Z henrik $
11"""
12close the Students StudyLevel
13"""
14try:
15    from Products.zdb import set_trace
16except:
17    def set_trace():
18        pass
19from urllib import urlencode
20request = context.REQUEST
21mtool = context.portal_membership
22member = mtool.getAuthenticatedMember()
23member_id = str(member)
24import logging
25logger = logging.getLogger('Skins.reject_courses')
26
27wftool = context.portal_workflow
28wftool.doActionFor(context,'open')
29wftool.doActionFor(context,'close_for_edit')
30students_folder = context.portal_url.getPortalObject().campus.students
31student = getattr(students_folder,context.getStudentId())
32wftool.doActionFor(student,'reject_courses')
33logger.info('%s rejected course list of %s' % (member,student.getId()))
34
35args = {}
36action = "/contact_student_form_2"
37psm = "Student's course list has been rejected! Please fill and submit the form below!"
38subject = "Course list rejected"
39args['subject'] = subject
40args['continue'] = 'study_level_view'
41args['portal_status_message'] = psm
42url = context.absolute_url() + action + '?' + urlencode(args)
43return REQUEST.RESPONSE.redirect(url)
44
45#return request.RESPONSE.redirect("%s" % context.absolute_url())
Note: See TracBrowser for help on using the repository browser.