Changeset 1042


Ignore:
Timestamp:
13 Dec 2006, 13:35:50 (18 years ago)
Author:
joachim
Message:

improved isStudent speed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_default/isStudent.py

    r885 r1042  
    1010# $Id$
    1111
     12#session = context.REQUEST.SESSION
     13#roles = member.getRolesInContext(context)
     14#return  "Student" in roles
     15
    1216mtool = context.portal_membership
    13 roles = mtool.getAuthenticatedMember().getRolesInContext(context)
    14 return  "Student" in roles
     17member = mtool.getAuthenticatedMember()
     18member_id = str(member)
     19if len(member_id) == 7:
     20    try:
     21        int(member_id[1:])
     22        return True
     23    except:
     24        return False
Note: See TracChangeset for help on using the changeset viewer.