## Script (Python) "getStudentInfo" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title= ## # $Id: getStudentWorkflowInfo.py 1072 2006-12-16 17:04:42Z joachim $ """ return Info about the current Student """ import logging logger = logging.getLogger('getApplicationInfo') request = context.REQUEST mtool = context.portal_membership wf = context.portal_workflow member = mtool.getAuthenticatedMember() member_id = str(member) path_info = request.get('PATH_INFO').split('/') if mtool.isAnonymousUser(): return None info = {} #from Products.zdb import set_trace #set_trace() requested_id = context.getStudentId() if member_id != requested_id: logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id)) return None student_id = member_id students_object = context.portal_url.getPortalObject().campus.students student = getattr(students_object, student_id) info['id'] = student_id #info['student'] = student info['url'] = student.absolute_url() info['review_state'] = wf.getInfoFor(student,'review_state',None) return info