Last change
on this file since 1075 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:
779 bytes
|
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: getStudentName.py 1071 2006-12-16 15:53:13Z joachim $ |
---|
11 | """ |
---|
12 | return Info about the current Student |
---|
13 | """ |
---|
14 | import logging |
---|
15 | logger = logging.getLogger('getApplicationInfo') |
---|
16 | |
---|
17 | request = context.REQUEST |
---|
18 | mtool = context.portal_membership |
---|
19 | wf = context.portal_workflow |
---|
20 | member = mtool.getAuthenticatedMember() |
---|
21 | member_id = str(member) |
---|
22 | path_info = request.get('PATH_INFO').split('/') |
---|
23 | |
---|
24 | if mtool.isAnonymousUser(): |
---|
25 | return None |
---|
26 | |
---|
27 | info = {} |
---|
28 | #from Products.zdb import set_trace |
---|
29 | #set_trace() |
---|
30 | student_id = context.getStudentId() |
---|
31 | if not student_id: |
---|
32 | return None |
---|
33 | res = context.students_catalog(id = student_id) |
---|
34 | if len(res) != 1: |
---|
35 | return None |
---|
36 | return res[0].name |
---|
Note: See
TracBrowser for help on using the repository browser.