Changeset 3198


Ignore:
Timestamp:
22 Feb 2008, 08:34:18 (17 years ago)
Author:
joachim
Message:

resolve #484 uniben
+ #100 okene

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTool.py

    r3195 r3198  
    5858i_home = INSTANCE_HOME
    5959images_base = os.path.join(i_home,"images")
     60EMPTY = 'XXX'
    6061
    6162def getImagesDir(student_id):
     
    858859        students_folder = self.portal_url.getPortalObject().campus.students
    859860        logger = logging.getLogger('WAeUPTool.admitOneStudent')
     861        res = self.students_catalog(jamb_reg_no = brain.reg_no)
     862        if res:
     863            logger.info('student with this reg_no already exists %s with id %s' % (brain.reg_no,res[0].id))
     864            return
    860865        if brain.status != "admitted":
    861866            logger.info('status of %s is %s' % (brain.reg_no,brain.status))
     
    14641469        for record in items:
    14651470            item = {}
     1471            empty_value_keys = []
    14661472            for k,v in record.items():
    14671473                if v:
     1474                    if v == EMPTY:
     1475                        empty_value_keys += k,
     1476                        v = ''
    14681477                    item[k.strip()] = v.strip()
    14691478            count += 1
     
    15031512                error = results[1]
    15041513                mapping = results[2]
     1514            for k in empty_value_keys:
     1515                mapping[k] = EMPTY
    15051516            if mapping.has_key('sex'):
    15061517                #import pdb;pdb.set_trace()
Note: See TracChangeset for help on using the changeset viewer.