Changeset 17659 for main/waeup.uniben/trunk/src
- Timestamp:
- 22 Dec 2023, 16:47:45 (12 months ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py
r17597 r17659 21 21 22 22 #from grok import getSite 23 import re 23 24 from zope import schema 24 25 from zope.interface import invariant, Invalid … … 55 56 from waeup.uniben.payments.interfaces import ICustomOnlinePayment 56 57 58 59 # Define a validation method for JAMB reg numbers 60 class NotMatricRegNumber(schema.ValidationError): 61 __doc__ = u"Invalid matriculation number" 62 63 #: Regular expression to check matric_number formats. 64 check_matric_number = re.compile(r"^[^0-9\s][^\s]*$").match 65 66 def validate_matric_number(value): 67 if not check_matric_number(value): 68 raise NotMatricRegNumber(value) 69 return True 70 57 71 class TranscriptCertificateSource(CertificateSource): 58 72 """Include Department and Faculty in Title. … … 316 330 readonly = False, 317 331 required = True, 332 constraint = validate_matric_number, 318 333 ) 319 334 … … 434 449 dispatch_address = schema.Text( 435 450 title = _(u'Recipient Body'), 436 description = u'Addresses (including email address and phone number) ' 437 'to which transcripts should be posted. ' 451 description = u'Addresses to which transcripts should be posted. ' 438 452 'All addresses must involve same courier charges.', 439 453 required = True, 440 454 readonly = False, 455 ) 456 457 dispatch_email = schema.ASCIILine( 458 title = _(u'Recipient Email Address'), 459 required = False, 460 constraint=validate_email, 461 ) 462 463 dispatch_phone = PhoneNumber( 464 title = _(u'Recipient Phone'), 465 description = u'', 466 required = False, 441 467 ) 442 468 -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/tests/test_browser.py
r17593 r17659 336 336 self.browser.getControl(name="form.no_copies").value = ['2'] 337 337 self.browser.getControl(name="form.course_studied").value = ['CERT1'] 338 self.browser.getControl(name="form.matric_number").value = ' 234'338 self.browser.getControl(name="form.matric_number").value = 'a234' 339 339 self.browser.getControl(name="form.dispatch_address").value = 'Kuensche\nMarsch 5' 340 340 self.browser.getControl(name="form.entry_mode").value = ['ug_ft']
Note: See TracChangeset for help on using the changeset viewer.