- Timestamp:
- 31 Aug 2012, 15:14:21 (12 years ago)
- 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
r9134 r9135 28 28 cert.end_level = 500 29 29 self.certificate = cert 30 31 def get(self, attr, default=None):32 try:33 return self.__getattribute__(attr)34 except AttributeError:35 return default36 30 37 31 class VocabularyTests(unittest.TestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/students/vocabularies.py
r9133 r9135 37 37 38 38 def study_levels(context): 39 if context.get('certificate', None) is not None: 40 start_level = int(context.certificate.start_level) 41 end_level = int(context.certificate.end_level) 39 certificate = getattr(context, 'certificate', None) 40 if certificate is not None: 41 start_level = int(certificate.start_level) 42 end_level = int(certificate.end_level) 42 43 if start_level == 999 or end_level == 999: 43 44 levels = [999] … … 69 70 70 71 def getTitle(self, context, value): 71 if context.get('certificate', None) is not None: 72 start_level = int(context.certificate.start_level) 73 end_level = int(context.certificate.end_level) 72 certificate = getattr(context, 'certificate', None) 73 if certificate is not None: 74 start_level = int(certificate.start_level) 75 end_level = int(certificate.end_level) 74 76 else: 75 77 # default level range
Note: See TracChangeset for help on using the changeset viewer.