source: WAeUP_SRP/trunk/skins/waeup_student/validate_courses.py @ 1596

Last change on this file since 1596 was 1589, checked in by joachim, 18 years ago

added try: except: for workflow actions resolved ticket 128

File size: 1.3 KB
Line 
1## Script (Python) "validate_courses"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=student=None, action_after_reject=None, action_after_validate=None
8##title=
9##
10# $Id: getStudyCourseInfo.py 1504 2007-02-26 21:20:40Z henrik $
11"""
12close the Students StudyLevel
13"""
14from Products.CMFCore.WorkflowCore import WorkflowException
15try:
16    from Products.zdb import set_trace
17except:
18    def set_trace():
19        pass
20
21request = context.REQUEST
22mtool = context.portal_membership
23member = mtool.getAuthenticatedMember()
24member_id = str(member)
25import logging
26logger = logging.getLogger('Skins.validate_courses')
27
28wftool = context.portal_workflow
29students_folder = context.portal_url.getPortalObject().campus.students
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 TracBrowser for help on using the repository browser.