Changeset 1589


Ignore:
Timestamp:
19 Mar 2007, 13:27:39 (18 years ago)
Author:
joachim
Message:

added try: except: for workflow actions resolved ticket 128

Location:
WAeUP_SRP/trunk/skins/waeup_student
Files:
3 edited

Legend:

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

    r1583 r1589  
    4040    logger.info('%s WorkflowException %s for %s' % (member_id,E,student_id))
    4141    return request.RESPONSE.redirect("%s" % context.absolute_url())
    42 logger.info('%s registered course list for %s' % (member_id,student_id))
     42logger.info('%s registered course list of %s' % (member_id,student_id))
    4343return request.RESPONSE.redirect("%s" % context.absolute_url())
  • WAeUP_SRP/trunk/skins/waeup_student/reject_courses.py

    r1588 r1589  
    1212close the Students StudyLevel
    1313"""
     14from Products.CMFCore.WorkflowCore import WorkflowException
    1415try:
    1516    from Products.zdb import set_trace
     
    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 rejected course list of %s' % (member,student.getId()))
     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))
    3440
    3541args = {}
     
    4248url = context.absolute_url() + '/' + action_after_reject + '?' + urlencode(args)
    4349return REQUEST.RESPONSE.redirect(url)
    44 
    45 #return request.RESPONSE.redirect("%s" % context.absolute_url())
  • WAeUP_SRP/trunk/skins/waeup_student/validate_courses.py

    r1588 r1589  
    1212close the Students StudyLevel
    1313"""
     14from Products.CMFCore.WorkflowCore import WorkflowException
    1415try:
    1516    from Products.zdb import set_trace
     
    2728wftool = context.portal_workflow
    2829students_folder = context.portal_url.getPortalObject().campus.students
    29 student = getattr(students_folder,context.getStudentId())
    30 wftool.doActionFor(student,'validate_courses')
    31 logger.info('%s validated course list of %s' % (member,student.getId()))
     30student_id = context.getStudentId()
     31student = getattr(students_folder,student_id)
     32try:
     33    wftool.doActionFor(student,'validate_courses')
     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())
     37logger.info('%s validated course list of %s' % (member_id,student_id))
    3238
    3339psm = 'portal_status_message=Course list validated!'
    3440url = context.absolute_url() + '/' + action_after_validate +  '?' + psm
    3541return request.RESPONSE.redirect(url)
    36 
    37 
Note: See TracChangeset for help on using the changeset viewer.