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

    r1513 r1593  
    1 ## Script (Python) "getStudyCourseInfo"
     1## Script (Python) "validate_courses"
    22##bind container=container
    33##bind context=context
     
    55##bind script=script
    66##bind subpath=traverse_subpath
    7 ##parameters=student=None
     7##parameters=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
     
    2324member_id = str(member)
    2425import logging
    25 logger = logging.getLogger('Student.validate_courses')
     26logger = logging.getLogger('Skins.validate_courses')
    2627
    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 courses for","%s"' % (member,student.getId()))
    32 return request.RESPONSE.redirect("%s" % context.absolute_url())
     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))
     38
     39psm = 'portal_status_message=Course list validated!'
     40url = context.absolute_url() + '/' + action_after_validate +  '?' + psm
     41return request.RESPONSE.redirect(url)
Note: See TracChangeset for help on using the changeset viewer.