Changeset 8472 for main/waeup.kofa/trunk/src/waeup/kofa/university
- Timestamp:
- 20 May 2012, 09:57:09 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/university/interfaces.py
r8299 r8472 20 20 21 21 from zope import schema 22 from zope.interface import Attribute 22 from zope.interface import Attribute, invariant, Invalid 23 23 from waeup.kofa.interfaces import (IKofaObject, IKofaContainer) 24 24 from waeup.kofa.interfaces import MessageFactory as _ … … 245 245 """ 246 246 247 @invariant 248 def check_pg_conditions(cert): 249 if cert.start_level == 999 and not cert.end_level == 999: 250 raise Invalid(_("Start level and end level must correspond.")) 251 if cert.end_level == 999 and not cert.start_level == 999: 252 raise Invalid(_("Start level and end level must correspond.")) 253 if cert.study_mode.startswith('pg') and not cert.start_level == 999: 254 raise Invalid(_( 255 "Study mode, start level and end level must correspond.")) 256 if cert.start_level == 999 and not cert.study_mode.startswith('pg'): 257 raise Invalid(_( 258 "Study mode, start level and end level must correspond.")) 259 260 247 261 class ICertificateAdd(ICertificate): 248 262 """Representation of a certificate.
Note: See TracChangeset for help on using the changeset viewer.