Changeset 9778 for main/waeup.kofa/trunk


Ignore:
Timestamp:
6 Dec 2012, 15:45:03 (12 years ago)
Author:
Henrik Bettermann
Message:

Catch error.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_vocabularies.py

    r9777 r9778  
    107107        self.assertEqual(studylevelsource.getTitle(studycourse, 10),
    108108            'Pre-Studies')
     109        self.assertEqual(studylevelsource.getTitle(studycourse, 100),
     110            'Error: level id ${value} out of range')
     111        self.assertEqual(studylevelsource.getTitle(studycourse, 200),
     112            'Error: level id ${value} out of range')
    109113        # Finally we modify the certificate to be a mixed course,
    110114        # starting with pre-studies.
  • main/waeup.kofa/trunk/src/waeup/kofa/students/vocabularies.py

    r9776 r9778  
    8989            start_level = 10
    9090            end_level = 1000
    91         if start_level == 999 or end_level == 999:
     91        if 999 in (start_level, end_level):
    9292            if value != 999:
    9393                return _('Error: wrong level id ${value}',
     
    9595        if value == 999:
    9696            return course_levels.by_value[999].title
     97        if start_level == 10 and end_level == 10 and value != 10:
     98            return _('Error: level id ${value} out of range',
     99                mapping={'value': value})
    97100        if value < start_level or value > end_level + 120:
    98101            return _('Error: level id ${value} out of range',
Note: See TracChangeset for help on using the changeset viewer.