Last change
on this file since 3349 was
1959,
checked in by joachim, 18 years ago
|
faster method to detect isStudent
|
-
Property svn:keywords set to
Id
|
File size:
476 bytes
|
Line | |
---|
1 | ## Script (Python) "isStudent" |
---|
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: isStudent.py 1959 2007-06-25 20:17:04Z joachim $ |
---|
11 | |
---|
12 | member_id = str(context.portal_membership.getAuthenticatedMember()) |
---|
13 | #from Products.zdb import set_trace;set_trace() |
---|
14 | # if len(member_id) != 7: |
---|
15 | # return False |
---|
16 | # try: |
---|
17 | # int(member_id[1:]) |
---|
18 | # return True |
---|
19 | # except: |
---|
20 | # return False |
---|
21 | o = ord(member_id[1]) |
---|
22 | return o >= 48 and o <= 57 |
---|
Note: See
TracBrowser for help on using the repository browser.