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/register_courses.py

    r1513 r1593  
    1 ## Script (Python) "getStudyCourseInfo"
     1## Script (Python) "register_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
     
    1819        pass
    1920
     21from urllib import urlencode       
     22
    2023request = context.REQUEST
    2124mtool = context.portal_membership
     
    2326member_id = str(member)
    2427import logging
    25 logger = logging.getLogger('Student.register_courses')
     28logger = logging.getLogger('Skins.register_courses')
    2629
    2730wftool = context.portal_workflow
    28 wftool.doActionFor(context,'close')
    2931students_folder = context.portal_url.getPortalObject().campus.students
    30 student = getattr(students_folder,context.getStudentId())
    31 wftool.doActionFor(student,'register_courses')
    32 logger.info('"%s","courses registered"' % student.getId())
    33 return request.RESPONSE.redirect("%s" % context.absolute_url())
     32student_id = context.getStudentId()
     33student = getattr(students_folder,student_id)
     34try:
     35    wftool.doActionFor(context,'close')
     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())
     39try:
     40    wftool.doActionFor(student,'register_courses')
     41except WorkflowException,E:
     42    logger.info('%s WorkflowException %s for %s' % (member_id,E,student_id))
     43    return request.RESPONSE.redirect("%s" % context.absolute_url())
     44logger.info('%s registered course list of %s' % (member_id,student_id))
     45
     46args = {}
     47psm = "You successfully submitted your course list!"
     48args['portal_status_message'] = psm
     49url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
     50return REQUEST.RESPONSE.redirect(url)
Note: See TracChangeset for help on using the changeset viewer.