source: WAeUP_SRP/trunk/skins/waeup_student/getApplicationInfo.py @ 1090

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

correct fix for getApplicationInfo

  • Property svn:keywords set to Id
File size: 1.2 KB
RevLine 
[1071]1## Script (Python) "getStudentInfo"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=
8##title=
9##
10# $Id: getApplicationInfo.py 1090 2006-12-19 07:31:18Z joachim $
11"""
12return Info about the current Student
13"""
14import logging
[1082]15logger = logging.getLogger('Student.Application.Info')
[1071]16
17request = context.REQUEST
18mtool = context.portal_membership
19wf = context.portal_workflow
20member = mtool.getAuthenticatedMember()
21member_id = str(member)
22path_info = request.get('PATH_INFO').split('/')
[1078]23##from Products.zdb import set_trace
24##set_trace()
[1071]25if mtool.isAnonymousUser():
26    return None
27info = {}
28requested_id = context.getStudentId()
[1090]29if requested_id and not context.isStaff() and member_id != requested_id:
[1088]30    logger.info('"%s", "accessed application object of", "%s"' % (member_id,requested_id))
31    student_id = requested_id
[1090]32elif context.isStaff():
33    student_id = requested_id
[1088]34else:
[1071]35    student_id = member_id
36
37
38students_object = context.portal_url.getPortalObject().campus.students
39student = getattr(students_object, student_id)
40info['id'] = student_id
41info['student'] = student
42info['review_state'] = wf.getInfoFor(student,'review_state',None)
43info['app'] = student.application
44info['app_doc'] = student.application.getContent()
45return info
Note: See TracBrowser for help on using the repository browser.