Changeset 5452 for main/waeup.sirp/trunk


Ignore:
Timestamp:
18 Aug 2010, 12:23:43 (14 years ago)
Author:
uli
Message:

Handle JAMB screened applicants and others differently.

File:
1 edited

Legend:

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

    r5447 r5452  
    3838    IApplicantPrincipalInfo, IApplicantPrincipal, IApplicantSessionCredentials,
    3939    IJAMBApplicantSessionCredentials)
    40 from waeup.sirp.jambtables.util import get_applicant_data
     40from waeup.sirp.jambtables.util import get_applicant_data, application_exists
    4141from waeup.sirp.accesscodes import get_access_code
    4242
     
    212212        credentials = None
    213213
    214         print "CRED2: %s, %s" % (access_code, jamb_reg_no)
    215214        if access_code and jamb_reg_no:
    216215            credentials = JAMBApplicantCredentials(
     
    228227        if not credentials:
    229228            return None
    230         if credentials.getJAMBRegNo() is not None:
    231             return {'accesscode': credentials.getAccessCode(),
    232                     'jambregno': credentials.getJAMBRegNo()}
    233         return {'accesscode': credentials.getAccessCode()}
     229        if not IJAMBApplicantSessionCredentials.providedBy(credentials):
     230            # Entered credentials are ordinary applicant credentials,
     231            # not JAMB-screened applicant credentials
     232            return {'accesscode': credentials.getAccessCode()}
     233        return {'accesscode': credentials.getAccessCode(),
     234                'jambregno': credentials.getJAMBRegNo()}
     235
    234236
    235237
     
    255257            # XXX: log this.
    256258            return None
     259        if credentials['jambregno'] is not None:
     260            # applications of JAMB applicants must exist already
     261            if not application_exists(credentials['jambregno']):
     262                return None
    257263        return ApplicantPrincipalInfo(
    258264            credentials['accesscode'], credentials['jambregno']
Note: See TracChangeset for help on using the changeset viewer.