Changeset 1583 for WAeUP_SRP


Ignore:
Timestamp:
19 Mar 2007, 11:07:54 (18 years ago)
Author:
joachim
Message:

catch workflowexeptions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/register_courses.py

    r1571 r1583  
    1212close the Students StudyLevel
    1313"""
     14from Products.CMFCore.WorkflowCore import WorkflowException
    1415try:
    1516    from Products.zdb import set_trace
     
    2627
    2728wftool = context.portal_workflow
    28 wftool.doActionFor(context,'close')
    2929students_folder = context.portal_url.getPortalObject().campus.students
    30 student = getattr(students_folder,context.getStudentId())
    31 wftool.doActionFor(student,'register_courses')
    32 logger.info('%s registered course list' % student.getId())
     30student_id = context.getStudentId()
     31student = getattr(students_folder,student_id)
     32try:
     33    wftool.doActionFor(context,'close')
     34except WorkflowException,E:
     35    logger.info('%s WorkflowException %s for %s' % (member_id,E,student_id))
     36    return request.RESPONSE.redirect("%s" % context.absolute_url())
     37try:
     38    wftool.doActionFor(student,'register_courses')
     39except WorkflowException,E:
     40    logger.info('%s WorkflowException %s for %s' % (member_id,E,student_id))
     41    return request.RESPONSE.redirect("%s" % context.absolute_url())
     42logger.info('%s registered course list for %s' % (member_id,student_id))
    3343return request.RESPONSE.redirect("%s" % context.absolute_url())
Note: See TracChangeset for help on using the changeset viewer.