## Script (Python) "getApplicationInfo" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title= ## # $Id: getApplicationInfo.py 2335 2007-10-09 17:34:04Z joachim $ """ return Info about the current Student """ 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('/') ##from Products.zdb import set_trace ##set_trace() if mtool.isAnonymousUser(): return None info = {} requested_id = context.getStudentId() if requested_id and not context.isStaff() and member_id != requested_id: import logging logger = logging.getLogger('Skins.getApplicationInfo') logger.info('%s tried to access application object of %s' % (member_id,requested_id)) student_id = requested_id return None elif context.isStaff(): student_id = requested_id else: 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['review_state'] = context.getStudentReviewState() info['app'] = student.application info['app_doc'] = student.application.getContent() #info['name'] = context.getStudentName() return info