Changeset 2004 for WAeUP_SRP/trunk/skins/waeup_utilities
- Timestamp:
- 10 Jul 2007, 04:50:22 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_utilities/ti_306_resolve.py
r2003 r2004 39 39 40 40 total = len(pins) 41 logger.info('started, %d PINs found' % total) 41 42 42 43 for brain in pins: … … 49 50 sbrain = sbrains[0] 50 51 else: 51 logger.info('%s , %s' % (brain.student,brain.pin))52 logger.info('%s %s' % (brain.pin,brain.student)) 52 53 continue 53 54 try: … … 56 57 logger.info('%s, application does not exist' % (brain.student)) 57 58 continue 58 application.getContent().edit(mapping={'app_ac_pin ': brain.pin}) 59 logger.info('%s, %s replaced' % (brain.student,brain.pin)) 59 prefix,batch_no,number = brain.pin[:3],brain.pin[3:-10],brain.pin[-10:] 60 app_doc = application.getContent() 61 if app_doc.app_ac_pin.startswith('APP'): 62 logger.info('%s, %s, %s already shows correct PIN %s (reason: check_admission failed the first time)' % (count, brain.student,sbrain.id,app_doc.app_ac_pin)) 63 continue 64 app_doc.edit(mapping={'app_ac_pin' : '%s-%s-%s' % (prefix,batch_no,number)}) 65 logger.info('%s, %s, %s, %s-%s-%s replaced' % (count, brain.student,sbrain.id,prefix,batch_no,number)) 60 66 count += 1 61 67 if count and not count % commit_after: 62 68 context.waeup_tool.doCommit() 63 69 logger.info("committed %d transactions" % commit_after) 64 return65 70 logger.info('finished for %d of %d' % (count,total)) 66 71 return
Note: See TracChangeset for help on using the changeset viewer.