Changeset 2540


Ignore:
Timestamp:
5 Nov 2007, 18:47:31 (17 years ago)
Author:
joachim
Message:

new function admitStudents please check

Location:
WAeUP_SRP/base
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTool.py

    r2528 r2540  
    641641        if brain.status != "admitted":
    642642            logger.info('status of %s is %s' % (brain.reg_no,brain.status))
     643            return
    643644        pin_parts = brain.pin.split('-')
    644645        if len(pin_parts) != 3:
    645646            logger.info('invalid pin %s for %s' % (brain.pin,brain.reg_no))
    646         student_id = self.generateStudentId(letter)
     647            return
     648        student_id = self.generateStudentId('?')
    647649        students_folder.invokeFactory('Student', student_id)
    648650        student_object = getattr(students_folder,student_id)
    649651        password = pin_parts[2]
    650652        self.makeStudentMember(student_id,password = password)
    651         student.manage_setLocalRoles(sid, ['Owner',])
    652         logger.info("creating %s reg_no %s" % (student_id,brain.reg_no))
     653        student_object.manage_setLocalRoles(student_id, ['Owner',])
     654        #logger.info("creating %s reg_no %s" % (student_id,brain.reg_no))
    653655        #
    654656        # application
    655657        #
    656         student_obj.invokeFactory('StudentApplication','application')
    657         application = student_obj.application
     658        student_object.invokeFactory('StudentApplication','application')
     659        application = student_object.application
    658660        self.portal_workflow.doActionFor(application,'open',dest_container=application)
    659661        da = {'Title': 'Application Data'}
     
    661663        da['entry_mode'] = brain.entry_mode
    662664        da['jamb_lastname'] = brain.lastname
    663         da['jamb_sex'] = brain.sex
    664         da['jamb_lga'] = brain.lga
     665        sex = 'M'
     666        if brain.sex:
     667            sex = 'F'
     668        da['jamb_sex'] = sex
     669        da['app_ac_pin'] = brain.pin
     670        state_lga = brain.lga.split('_')
     671        da['state_lga'] = state_lga[0]
     672        da['jamb_lga'] = state_lga[-1]
     673        #da['jamb_score'] = brain.????
    665674        da['app_email'] = brain.email
    666         da['app_mobile'] = brain.phone_nr
     675        da['app_mobile'] = brain.phone
    667676        application.getContent().edit(mapping=da)
    668677        self.portal_workflow.doActionFor(application,'close',dest_container=application)
     
    670679        # personal
    671680        #
    672         student_obj.invokeFactory('StudentPersonal','personal')
    673         personal = student_obj.personal
     681        student_object.invokeFactory('StudentPersonal','personal')
     682        personal = student_object.personal
    674683        self.portal_workflow.doActionFor(personal,'open',dest_container=personal)
    675684        dp = {'Title': 'Personal Data'}
    676685        dp['sex'] = brain.sex
    677686        dp['email'] = brain.email
    678         dp['phone'] = brain.phone_nr
     687        dp['phone'] = brain.phone
    679688        dp['lastname'] = brain.lastname
    680689        personal.getContent().edit(mapping=dp)
     
    682691        # clearance
    683692        #
    684         student_obj.invokeFactory('StudentClearance','clearance')
    685         clearance = student_obj.clearance
     693        student_object.invokeFactory('StudentClearance','clearance')
     694        clearance = student_object.clearance
    686695        self.portal_workflow.doActionFor(clearance,'open',dest_container=clearance)
    687696        dc = {'Title': 'Clearance/Eligibility Record'}
     
    692701        # study Course
    693702        #
    694         student_obj.invokeFactory('StudentStudyCourse','study_course')
    695         studycourse = student_obj.study_course
     703        student_object.invokeFactory('StudentStudyCourse','study_course')
     704        studycourse = student_object.study_course
    696705        self.portal_workflow.doActionFor(studycourse,'open',dest_container=studycourse)
    697706        dsc = {}
     
    702711        #
    703712        # payments folder
    704         student_obj.invokeFactory('PaymentsFolder','payments')
    705         payments = getattr(student_obj,'payments')
     713        student_object.invokeFactory('PaymentsFolder','payments')
     714        payments = getattr(student_object,'payments')
    706715        dpay = {}
    707716        dpay['Title'] = 'Payments'
    708717        payments.getContent().edit(mapping=dpay)
    709         wftool.doActionFor(payments,'open')
     718        self.portal_workflow.doActionFor(payments,'open')
    710719        return student_id
    711720    ###)
Note: See TracChangeset for help on using the changeset viewer.