Changeset 1075 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
18 Dec 2006, 10:01:29 (18 years ago)
Author:
joachim
Message:

optimized

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/getStudentId.py

    r1071 r1075  
    1313"""
    1414
     15ptls = context.REQUEST.get('PATH_TRANSLATED')
     16start = ptls.find('/students/')
     17if start < -1:
     18    return None
     19start += 10
     20student_id = ptls[start:start+7]
     21try:
     22    int(student_id[1:])
     23    return student_id
     24except:
     25    return None
     26
    1527ptl = context.REQUEST.get('PATH_TRANSLATED').split('/')
    1628try:
     
    2335if len(student_id) != 7:
    2436    return None
    25 try:
    26     int(student_id[1:])
    27     return student_id
    28 except:
    29     return None
Note: See TracChangeset for help on using the changeset viewer.