Ignore:
Timestamp:
29 Jan 2024, 11:38:51 (8 months ago)
Author:
Henrik Bettermann
Message:

Modify application form. Upon application, the candidate must be seventeen years old (17).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.edocons/trunk/src/kofacustom/edocons/applicants/interfaces.py

    r17681 r17683  
    4242from kofacustom.nigeria.applicants.interfaces import (
    4343    LGASource, high_qual, high_grade, exam_types,
    44     jambsubjects,
     44    #jambsubjects,
    4545    INigeriaUGApplicant, INigeriaPGApplicant,
    4646    INigeriaApplicantOnlinePayment,
     
    5959    curr_year = datetime.now().year
    6060    return range(curr_year - 50, curr_year)
     61
     62jambsubjects = SimpleKofaVocabulary(
     63    (_('English'),'english_language'),
     64    #(_('Agricultural Science'),'agricultural_science'),
     65    #(_('Arabic'),'arabic'),
     66    (_('Biology'),'biology'),
     67    #(_('Book Keeping'),'book_keeping'),
     68    (_('Chemistry'),'chemistry'),
     69    #(_('Christian Religious Studies'),'christian_religious_studies'),
     70    #(_('Commerce'),'commerce'),
     71    #(_('Economics'),'economics'),
     72    #(_('Financial Accounting'),'financial_accounting'),
     73    #(_('Fine Art'),'fine_art'),
     74    #(_('Food and Nutrition'),'food_and_nutrition'),
     75    #(_('French'),'french'),
     76    #(_('Geography'),'geography'),
     77    #(_('German'),'german'),
     78    #(_('Government'),'government'),
     79    #(_('Hausa'),'hausa'),
     80    #(_('Home Economics'),'home_economics'),
     81    #(_('History'),'history'),
     82    #(_('Igbo'),'igbo'),
     83    #(_('Literature in English'),'literature_in_english'),
     84    #(_('Literature in Nigerian Languages'),'literature_in_nigerian_languages'),
     85    #(_('Mathematics'),'mathematics'),
     86    #(_('Music'),'music'),
     87    (_('Physics'),'physics'),
     88    #(_('Yoruba'),'yoruba'),
     89    )
    6190
    6291programme_types_vocab = SimpleKofaVocabulary(
     
    386415        )
    387416
     417    @invariant
     418    def date_of_birth(applicant):
     419        today = datetime.today()
     420        age = today.year - applicant.date_of_birth.year - ((today.month, today.day) < (applicant.date_of_birth.month, applicant.date_of_birth.day))
     421        if age < 17:
     422            raise Invalid(_("Upon application, the candidate must be seventeen years old (17)."))
     423
    388424class ICustomPGApplicant(INigeriaPGApplicant):
    389425    """A postgraduate applicant.
Note: See TracChangeset for help on using the changeset viewer.