Changeset 2447


Ignore:
Timestamp:
27 Oct 2007, 10:59:51 (17 years ago)
Author:
Henrik Bettermann
Message:

reload verdict and level

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/cps_custom/logged_in.py

    r2420 r2447  
    6565        elif student_app is None:
    6666            context.waeup_tool.makeStudentData(str(member))
    67            
     67
    6868        #########################################################
    6969
     
    129129        # look for passport pictures of new students
    130130
    131         if s_review_state in ('admitted', 
    132                               'clearance_pin_entered', 
     131        if s_review_state in ('admitted',
     132                              'clearance_pin_entered',
    133133                              'clearance_requested'
    134134                             )  and not context.waeup_tool.picturesExist(('passport',),
     
    202202        matric_no = res[0].matric_no
    203203        verdict = res[0].verdict
    204 
    205         #########################################################
    206 
    207         # fetch current verdict via getVerdict
    208 
    209         if s_review_state in ('returning','school_fee_paid') and not verdict:
    210             results = context.results_import(matric_no = matric_no)
    211             if results:
     204        level = res[0].level
     205        has_level = level and not level == '000'
     206        has_verdict = verdict and not verdict == 'N/A'
     207        #set_trace()
     208
     209        #########################################################
     210
     211        has_results = context.results_import(matric_no = matric_no)
     212
     213        #########################################################
     214       
     215        # fetch current verdict via getVerdict and level via getLevelFromResultsCosCode
     216
     217        if s_review_state in ('returning','school_fee_paid') and not (has_verdict or has_level):
     218            if has_results:
    212219                study_course = getattr(student,'study_course')
    213220                sc_review_state = wftool.getInfoFor(study_course,'review_state',None)
    214221                dsc = {}
    215                 dsc['current_verdict'] = context.getVerdict(results[0].Verdict)[0]
     222                if not has_verdict:
     223                    dsc['current_verdict'] = context.getVerdict(has_results[0].Verdict)[0]
     224                if not has_level and s_review_state == 'returning':
     225                    lnr = context.getLevelFromResultsCosCode(has_results)
     226                    dsc['current_level'] = "%d00" % lnr                   
    216227                if sc_review_state != 'opened':
    217228                    wftool.doActionFor(study_course,'open')
     
    222233        #########################################################
    223234
    224         has_results = context.results_import(matric_no = matric_no)
    225 
    226         #########################################################
    227235
    228236        # determine appropriate redirect url
Note: See TracChangeset for help on using the changeset viewer.