Changeset 1881


Ignore:
Timestamp:
12 Jun 2007, 08:03:32 (18 years ago)
Author:
Henrik Bettermann
Message:

Three bugs removed:

0 instead of '0'
context instead of self (twice)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_utilities/ti_229_resolve.py

    r1879 r1881  
    3838logger.info('ti_229 started')
    3939
    40 query = In('level',('0',''))
     40query = In('level',(0,''))
    4141brains = aq_students(query)
    4242total = len(brains)
     
    5050        logger.info('study_course of %s not found' % brain.id)
    5151        continue
    52     count += 1
    5352    s_results = context.results_import(matric_no = brain.matric_no)
    5453    if s_results:
    55         lnr = self.getLevelFromResultsCosCode(s_results)
     54        lnr = context.getLevelFromResultsCosCode(s_results)
    5655        level = "%d00" % lnr
    57         verdict,eligible = self.getVerdict(s_results[0].Verdict)
     56        verdict,eligible = context.getVerdict(s_results[0].Verdict)
    5857        if eligible:
    5958            level = "%d00" % (lnr + 1)
     
    6160        logger.info('matric_no %s not found in results_import' % brain.matric_no)
    6261        continue
     62    count += 1
     63
    6364    study_course.getContent().edit(mapping={'current_level': level,
    6465                                            'current_verdict': verdict,
    6566                                           }
    6667                                  )
    67     try:
    68         study_course = getattr(getattr(students,brain.id),'study_course')
    69     except:
    70         logger.info('study_course of %s not found' % brain.id)
    71         continue
    72     study_course.getContent().edit(mapping={'current_mode': '%s_ft' % brain.entry_mode.lower()})
    73     logger.info('%d of %d changed level,verdict of %s to %s,%s'  % (count,
     68    logger.info('%d of %d changed level/verdict of %s to %s/%s'  % (count,
    7469                                                                    total,
    7570                                                                    brain.id,
     
    8176        logger.info("committed %d transactions" % commit_after)
    8277logger.info('ti_229 finished for %d of %d' % (count,total))
     78return
Note: See TracChangeset for help on using the changeset viewer.