Changeset 16558 for main/kofacustom.iuokada/trunk/src/kofacustom
- Timestamp:
- 25 Jul 2021, 21:56:36 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/interfaces.py
r16553 r16558 20 20 """ 21 21 22 import re 22 23 from zope import schema 23 24 from zope.component import getUtility … … 51 52 from kofacustom.iuokada.payments.interfaces import ICustomOnlinePayment 52 53 54 # Define a validation method for JAMB reg numbers 55 class NotJAMBRegNumber2(schema.ValidationError): 56 __doc__ = u"Your JAMB detail is not valid for this admission session, contact admission office for details." 57 58 #: Regular expression to check jamb_reg_number formats. 59 check_jamb_reg_number_2 = re.compile(r"^1\d{7}[A-Z]{2}$").match 60 61 def validate_jamb_reg_number_2(value): 62 if not check_jamb_reg_number_2(value): 63 raise NotJAMBRegNumber2(value) 64 return True 65 66 53 67 sponsors_vocab = SimpleKofaVocabulary( 54 68 (_('Bauchi Government'), 'bauchi'), … … 691 705 title = _(u'JAMB Registration Number'), 692 706 required = True, 693 constraint=validate_jamb_reg_number ,707 constraint=validate_jamb_reg_number_2, # temporarily in 2021 694 708 description = _(u'Use all CAPS when entering the field.'), 695 709 )
Note: See TracChangeset for help on using the changeset viewer.