Changeset 1959


Ignore:
Timestamp:
25 Jun 2007, 20:17:04 (18 years ago)
Author:
joachim
Message:

faster method to detect isStudent

Location:
WAeUP_SRP/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/PatchCPSUserFolderUserFolder.py

    r1957 r1959  
    8181        #except:
    8282        #    break
    83         for c in name:
    84             is_student = True
    85             if c not in ('0123456789'):
    86                 is_student = False
    87         if is_student and len(name) == 7:
     83        o = ord(name[1])
     84        if o >= 48 and o <= 57:
    8885            break
    8986        groups = self.portal_membership.getAuthenticatedMember().getGroups()
  • WAeUP_SRP/trunk/skins/waeup_default/isCourseAdviser.py

    r1957 r1959  
    1111member = context.portal_membership.getAuthenticatedMember()
    1212member_id = str(member)
    13 for c in member_id:
    14     is_student = True
    15     if c not in ('0123456789'):
    16         is_student = False
    17         break
    18 if is_student and len(member_id) == 7:
     13o = ord(member_id[1])
     14if o >= 48 and o <= 57:
    1915    return False
    2016# if context.isStudent():
  • WAeUP_SRP/trunk/skins/waeup_default/isSectionOfficer.py

    r1957 r1959  
    1212member = context.portal_membership.getAuthenticatedMember()
    1313member_id = str(member)
    14 for c in member_id:
    15     is_student = True
    16     if c not in ('0123456789'):
    17         is_student = False
    18         break
    19 if is_student and len(member_id) == 7:
     14o = ord(member_id[1])
     15if o >= 48 and o <= 57:
    2016    return False
    2117# if context.isStudent():
  • WAeUP_SRP/trunk/skins/waeup_default/isStaff.py

    r1957 r1959  
    1717member = mtool.getAuthenticatedMember()
    1818member_id = str(member)
    19 for c in member_id:
    20     is_student = True
    21     if c not in ('0123456789'):
    22         is_student = False
    23         break
    24 return not (is_student and len(member_id) == 7)
     19o = ord(member_id[1])
     20return not (o >= 48 and o <= 57)
  • WAeUP_SRP/trunk/skins/waeup_default/isStudent.py

    r1957 r1959  
    1919# except:
    2020#     return False
    21 for c in member_id:
    22     is_student = True
    23     if c not in ('0123456789'):
    24         is_student = False
    25         break
    26 return is_student and len(member_id) == 7
     21o = ord(member_id[1])
     22return o >= 48 and o <= 57
Note: See TracChangeset for help on using the changeset viewer.