Ignore:
Timestamp:
22 Aug 2010, 18:09:52 (14 years ago)
Author:
uli
Message:

Use external methods to handle accesscode-internal data stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/jambtables/util.py

    r5451 r5468  
    2323"""
    2424import grok
     25from waeup.sirp.accesscodes import get_access_code
    2526
    2627def get_applicant_data(reg_no, ac):
     
    3637    """
    3738    site = grok.getSite()
    38     if reg_no not in site['applications'].keys():
    39         return None
    40     applicant_data = site['applications'][reg_no]
    41     entries = site['accesscodes'].search(ac, 'pin')
    42     if len(entries) != 1:
    43         # XXX: If entries > 1 then we have a problem!
    44         return None
    45     # XXX: Maybe we have to mark reg_no as used here?
    46     return (applicant_data, entries[0])
     39    if reg_no is not None:
     40        applicant_data = site['applications'].get(reg_no, None)
     41    else:
     42        # Non-JAMB-screened applicants are stored by ac as key...
     43        applicant_data = site['applications'].get(ac, None)
     44    access_code = get_access_code(ac)
     45    return (applicant_data, access_code)
    4746
    4847def application_exists(identifier):
Note: See TracChangeset for help on using the changeset viewer.