Changeset 3264


Ignore:
Timestamp:
3 Mar 2008, 10:01:52 (17 years ago)
Author:
joachim
Message:

calculate application nr for sandwich students,
passport-foto still uses brain.reg_no

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTool.py

    r3251 r3264  
    859859        students_folder = self.portal_url.getPortalObject().campus.students
    860860        logger = logging.getLogger('WAeUPTool.admitOneStudent')
    861         res = self.students_catalog(jamb_reg_no = brain.reg_no)
     861        if brain.screening_type in ('cest','sandwich',):
     862            reg_no = "%s%s/07" % (brain.course1,brain.serial)
     863        else:
     864            reg_no = brain.reg_no
     865        res = self.students_catalog(jamb_reg_no = reg_no)
    862866        if res:
    863             logger.info('student with this reg_no already exists %s with id %s' % (brain.reg_no,res[0].id))
     867            logger.info('student with this reg_no already exists %s with id %s' % (reg_no,res[0].id))
    864868            return
    865869        if brain.status != "admitted":
    866             logger.info('status of %s is %s' % (brain.reg_no,brain.status))
     870            logger.info('status of %s is %s' % (reg_no,brain.status))
    867871            return
    868872        pin_parts = brain.pin.split('-')
    869873        if pin_parts and len(pin_parts) != 3:
    870             logger.info('invalid pin %s for %s' % (brain.pin,brain.reg_no))
     874            logger.info('invalid pin %s for %s' % (brain.pin,reg_no))
    871875            return
    872876        if brain.course_admitted not in self._v_certificates:
    873             logger.info('certificate %s not found for %s' % (brain.course_admitted,brain.reg_no))
     877            logger.info('certificate %s not found for %s' % (brain.course_admitted,reg_no))
    874878            return
    875879        if brain.sex not in (True,False):
    876             logger.info('sex of %s not available' % (brain.reg_no))
     880            logger.info('sex of %s not available' % (reg_no))
    877881            return
    878882        student_id = self.generateStudentId('?')
     
    883887            self.makeStudentMember(student_id,password = password)
    884888        student_object.manage_setLocalRoles(student_id, ['Owner',])
    885         #logger.info("creating %s reg_no %s" % (student_id,brain.reg_no))
     889        #logger.info("creating %s reg_no %s" % (student_id,reg_no))
    886890        #
    887891        # application
     
    891895        #self.portal_workflow.doActionFor(application,'open',dest_container=application)
    892896        da = {'Title': 'Application Data'}
    893         da['jamb_reg_no'] = brain.reg_no
     897        da['jamb_reg_no'] = reg_no
    894898
    895899        sex = 'M'
Note: See TracChangeset for help on using the changeset viewer.