Ignore:
Timestamp:
19 Mar 2007, 18:57:54 (18 years ago)
Author:
uli
Message:

Merged current trunk into uli-branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/branches/uli/skins/waeup_student/reject_courses.py

    r1515 r1593  
    1 ## Script (Python) "getStudyCourseInfo"
     1## Script (Python) "reject_courses"
    22##bind container=container
    33##bind context=context
     
    55##bind script=script
    66##bind subpath=traverse_subpath
    7 ##parameters=student=None
     7##parameters=REQUEST=None, student=None, action_after_reject=None, action_after_validate=None
    88##title=
    99##
     
    1212close the Students StudyLevel
    1313"""
     14from Products.CMFCore.WorkflowCore import WorkflowException
    1415try:
    1516    from Products.zdb import set_trace
     
    1718    def set_trace():
    1819        pass
    19 
     20from urllib import urlencode
    2021request = context.REQUEST
    2122mtool = context.portal_membership
     
    2324member_id = str(member)
    2425import logging
    25 logger = logging.getLogger('Student.reject_courses')
     26logger = logging.getLogger('Skins.reject_courses')
    2627
    2728wftool = context.portal_workflow
     
    2930wftool.doActionFor(context,'close_for_edit')
    3031students_folder = context.portal_url.getPortalObject().campus.students
    31 student = getattr(students_folder,context.getStudentId())
    32 wftool.doActionFor(student,'reject_courses')
    33 logger.info('"%s","rejects course list for","%s"' % (member,student.getId()))
    34 return request.RESPONSE.redirect("%s" % context.absolute_url())
     32student_id = context.getStudentId()
     33student = getattr(students_folder,student_id)
     34try:
     35    wftool.doActionFor(student,'reject_courses')
     36except WorkflowException,E:
     37    logger.info('%s WorkflowException %s for %s' % (member_id,E,student_id))
     38    return request.RESPONSE.redirect("%s" % context.absolute_url())
     39logger.info('%s rejected course list of %s' % (member_id,student_id))
     40
     41args = {}
     42
     43psm = "Student's course list has been rejected! Please fill and submit the form below!"
     44subject = "Course list rejected"
     45args['subject'] = subject
     46args['continue'] = action_after_validate
     47args['portal_status_message'] = psm
     48url = context.absolute_url() + '/' + action_after_reject + '?' + urlencode(args)
     49return REQUEST.RESPONSE.redirect(url)
Note: See TracChangeset for help on using the changeset viewer.