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

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

speed improvements for waeup_edit and portlet_session_info

  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
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 1071 2006-12-16 15:53:13Z joachim $
11"""
12return Info about the current Student
13"""
14import logging
15logger = logging.getLogger('getApplicationInfo')
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('/')
23
24if mtool.isAnonymousUser():
25    return None
26info = {}
27#from Products.zdb import set_trace
28#set_trace()
29requested_id = context.getStudentId()
30if member_id != requested_id:
31    logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
32    student_id = member_id
33    mtool.assertViewable(context)
34student_id = member_id
35
36
37students_object = context.portal_url.getPortalObject().campus.students
38student = getattr(students_object, student_id)
39info['id'] = student_id
40info['student'] = student
41info['review_state'] = wf.getInfoFor(student,'review_state',None)
42info['app'] = student.application
43info['app_doc'] = student.application.getContent()
44return info
Note: See TracBrowser for help on using the repository browser.