Rev | Line | |
---|
[1571] | 1 | ## Script (Python) "validate_courses" |
---|
[1513] | 2 | ##bind container=container |
---|
| 3 | ##bind context=context |
---|
| 4 | ##bind namespace= |
---|
| 5 | ##bind script=script |
---|
| 6 | ##bind subpath=traverse_subpath |
---|
| 7 | ##parameters=student=None |
---|
| 8 | ##title= |
---|
| 9 | ## |
---|
| 10 | # $Id: getStudyCourseInfo.py 1504 2007-02-26 21:20:40Z henrik $ |
---|
| 11 | """ |
---|
| 12 | close the Students StudyLevel |
---|
| 13 | """ |
---|
| 14 | try: |
---|
| 15 | from Products.zdb import set_trace |
---|
| 16 | except: |
---|
| 17 | def set_trace(): |
---|
| 18 | pass |
---|
| 19 | |
---|
| 20 | request = context.REQUEST |
---|
| 21 | mtool = context.portal_membership |
---|
| 22 | member = mtool.getAuthenticatedMember() |
---|
| 23 | member_id = str(member) |
---|
| 24 | import logging |
---|
[1571] | 25 | logger = logging.getLogger('Skins.validate_courses') |
---|
[1513] | 26 | |
---|
| 27 | wftool = context.portal_workflow |
---|
| 28 | students_folder = context.portal_url.getPortalObject().campus.students |
---|
| 29 | student = getattr(students_folder,context.getStudentId()) |
---|
| 30 | wftool.doActionFor(student,'validate_courses') |
---|
[1575] | 31 | logger.info('%s validated course list of %s' % (member,student.getId())) |
---|
| 32 | |
---|
| 33 | psm = 'portal_status_message=Course list validated!' |
---|
| 34 | url = context.absolute_url() + '?' + psm |
---|
| 35 | return request.RESPONSE.redirect(url) |
---|
| 36 | |
---|
| 37 | |
---|
Note: See
TracBrowser for help on using the repository browser.