Ignore:
Timestamp:
28 Feb 2008, 13:06:20 (17 years ago)
Author:
joachim
Message:

raise KeyError? if key is not in Vocabulary

File:
1 edited

Legend:

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

    r3041 r3254  
    3333    ikey = int(key)
    3434else:
    35     return ''
     35    raise KeyError
    3636level_nr,repeat = divmod(ikey, 100)
    3737l = []
    3838
    39 level = context.portal_vocabularies.levels.get("%d00" % level_nr)
     39level = context.portal_vocabularies.levels.get("%d00" % level_nr,None)
     40if level is None:
     41    raise KeyError
     42   
    4043if level_nr > end_level/100:
    4144    return "%s Spillover" % context.portal_vocabularies.levels.get("%d00" % (level_nr - 1))
Note: See TracChangeset for help on using the changeset viewer.