Changeset 2268 for WAeUP_SRP/base


Ignore:
Timestamp:
21 Sep 2007, 20:11:08 (17 years ago)
Author:
Henrik Bettermann
Message:

allow overwriting of matric_no or jamb_reg_no if student id is provided

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTool.py

    r2267 r2268  
    11561156            if not res:
    11571157                return '',"no student with id %s" % sid
    1158             elif matric_no and res[0].matric_no and\
     1158            if matric_no and res[0].matric_no and\
    11591159              matric_no != res[0].matric_no:
    1160                 return '%s' % res[0].id ,"student has no matric_no %s" % matric_no
    1161             elif jamb_reg_no and res[0].jamb_reg_no and\
     1160                logger.info("%s, old matric_no %s overwritten with %s" % (res[0].id,res[0].matric_no,matric_no))
     1161            if jamb_reg_no and res[0].jamb_reg_no and\
    11621162              jamb_reg_no != res[0].jamb_reg_no:
    1163                 return '%s' % res[0].id ,"student has no jamb_reg_no %s" % jamb_reg_no
     1163                logger.info("%s, old reg_no %s overwritten with %s" % (res[0].id,res[0].jamb_reg_no,jamb_reg_no))
    11641164        elif jamb_reg_no:
    11651165            res = self.students_catalog(jamb_reg_no = jamb_reg_no)
     
    11731173            editable_keys.remove('matric_no')
    11741174
    1175         # included only to change wf state from admitted to returning
    1176         if res[0].review_state not in ('admitted','objection_raised'):
    1177             return '%s' % res[0].id ,"student is not in state admitted or objection_raised"
    1178         # end inclusion
     1175        ## included only to change wf state from admitted to returning
     1176        #if res[0].review_state not in ('admitted','objection_raised'):
     1177        #    return '%s' % res[0].id ,"student is not in state admitted or objection_raised"
     1178        ## end inclusion
    11791179
    11801180        sid = res[0].id
     
    12101210
    12111211
    1212         # included only to change wf state from admitted to returning
    1213             if res[0].review_state in ('admitted','objection_raised'):
    1214                 new_state = f2t[pt]['wf_transition_return']
    1215                 sub_obj = getattr(student_obj,f2t[pt]['id'],None)
    1216                 if sub_obj and new_state != "remain":
    1217                     try:
    1218                         self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
    1219                     except:
    1220                         #logger.info('%s, wf transition %s of %s failed' % (sid,new_state,sub_obj.id))
    1221                         pass
    1222         if res[0].review_state in ('admitted','objection_raised'):
    1223             wfaction = 'return'
    1224             try:
    1225                 self.portal_workflow.doActionFor(student_obj,wfaction)
    1226                 logger.info('%s, wf state changed' % sid)
    1227                 any_change = True
    1228             except:
    1229                 logger.info('%s, wf transition failed, old state = %s' % (sid,res[0].review_state))
    1230                 pass
    1231         # end inclusion
     1212        ## included only to change wf state from admitted to returning
     1213        #    if res[0].review_state in ('admitted','objection_raised'):
     1214        #        new_state = f2t[pt]['wf_transition_return']
     1215        #        sub_obj = getattr(student_obj,f2t[pt]['id'],None)
     1216        #        if sub_obj and new_state != "remain":
     1217        #            try:
     1218        #                self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
     1219        #            except:
     1220        #                #logger.info('%s, wf transition %s of %s failed' % (sid,new_state,sub_obj.id))
     1221        #                pass
     1222        #if res[0].review_state in ('admitted','objection_raised'):
     1223        #    wfaction = 'return'
     1224        #    try:
     1225        #        self.portal_workflow.doActionFor(student_obj,wfaction)
     1226        #        logger.info('%s, wf state changed' % sid)
     1227        #        any_change = True
     1228        #    except:
     1229        #        logger.info('%s, wf transition failed, old state = %s' % (sid,res[0].review_state))
     1230        #        pass
     1231        ## end inclusion
    12321232
    12331233
Note: See TracChangeset for help on using the changeset viewer.