Changeset 5815 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 7 Mar 2011, 13:35:22 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/root.py
r5813 r5815 108 108 return 109 109 110 def get_applicant_data(reg_no, ac): 111 """Validate credentials and return applicant data. 112 113 Returns tuple ``(<APPLICANT_ENTRY>, <ACCESSCODE>) on 114 successful validation and ``None`` else. 110 def get_applicant_data(identifier): 111 """Get applicant data associated with `identifier`. 115 112 116 We expect a JAMB registration number and an access code in format 113 Returns the applicant object if successful and ``None`` else. 114 115 As `identifier` we expect an access code in format 117 116 like ``PREFIX-XXX-YYYYYYYY`` where ``PREFIX`` is something like 118 117 ``APP`` or ``PUDE``, ``XXX`` the access code series and … … 120 119 """ 121 120 site = grok.getSite() 122 if reg_no is not None: 123 applicant_data = site['applications'].get(reg_no, None) 124 else: 125 # Non-JAMB-screened applicants are stored by ac as key... 126 applicant_data = site['applications'].get(ac, None) 127 access_code = get_access_code(ac) 128 return (applicant_data, access_code) 121 for container in site['applicants'].values(): 122 applicant_data = container.get(identifier, None) 123 if applicant_data is not None: 124 return applicant_data 125 return None 129 126 130 127 def application_exists(identifier):
Note: See TracChangeset for help on using the changeset viewer.