Last change
on this file since 1161 was
1161,
checked in by Henrik Bettermann, 18 years ago
|
getStudentInfo replaced (not yet thoroughly tested!)
|
-
Property svn:keywords set to
Id
|
File size:
628 bytes
|
Line | |
---|
1 | ## Script (Python) "getStudentName" |
---|
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 1161 2006-12-31 07:50:50Z henrik $ |
---|
11 | """ |
---|
12 | return Info about the current Student |
---|
13 | """ |
---|
14 | mtool = context.portal_membership |
---|
15 | member = mtool.getAuthenticatedMember() |
---|
16 | if mtool.isAnonymousUser(): |
---|
17 | return None |
---|
18 | info = {} |
---|
19 | #from Products.zdb import set_trace |
---|
20 | #set_trace() |
---|
21 | if context.isStaff(): |
---|
22 | return member.getProperty('fullname',None) |
---|
23 | if not context.isStudent(): |
---|
24 | return None |
---|
25 | res = context.students_catalog(id = str(member)) |
---|
26 | if len(res) != 1: |
---|
27 | return None |
---|
28 | return res[0].name |
---|
Note: See
TracBrowser for help on using the repository browser.