Changeset 2650 for WAeUP_SRP/base/skins


Ignore:
Timestamp:
14 Nov 2007, 15:44:32 (17 years ago)
Author:
joachim
Message:

test for integer (in custom)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_student/getStudentLevelsVoc.py

    r2649 r2650  
    55"""
    66student_id = context.getStudentId()
     7end_level = 700
    78if student_id:
    8     end_level = int(context.students_catalog(id = student_id)[0].end_level)
    9 else:
    10     end_level = 600
    11 
     9    end_level = context.students_catalog(id = student_id)[0].end_level
     10    if end_level.isdigit():
     11        end_level = int(end_level)
     12   
    1213if key is None:
    1314    levels = [l for l in range(100,end_level+200,10)
     
    2728    return voc
    2829
    29 try:
     30if key.isdigit():
    3031    ikey = int(key)
    31 except ValueError:
     32else:
    3233    return ''
    3334level_nr,repeat = divmod(ikey, 100)
Note: See TracChangeset for help on using the changeset viewer.