Changeset 3417


Ignore:
Timestamp:
3 Apr 2008, 19:22:40 (17 years ago)
Author:
Henrik Bettermann
Message:

fix restorePins, student must be an empty strin

I'm wondering why wo don't use importPins. I tested it: it does the same job.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/ScratchCards.py

    r3415 r3417  
    3636    def importPinBatch(self):
    3737        """import PinBatch"""
    38         name = "PINS"
     38        name = "PinsToImport"
    3939        logger = logging.getLogger('Students.ScratchCardBatchesFolder.importPinBatch')
    4040        logger.info('Start loading from %s.csv' % name)
     
    132132        "restore Pins from file named pins_to_restore.csv"
    133133        pins = self.portal_pins
    134         filename = "%s/export/pins_to_restore.csv" % (i_home)
    135         logger = logging.getLogger('ScratchCards.restore')
     134        filename = "%s/import/PinsToRestore.csv" % (i_home)
     135        logger = logging.getLogger('ScratchCards.restorePins')
    136136        if not os.path.exists(filename):
    137137            logger.info('no file %s' % filename)
     
    152152            d['serial'] = record['Serial']
    153153            d['cost'] = record['Cost']
     154            d['student'] = ''
    154155            d['prefix_batch'] = "".join(record['Pin'].split('-')[:2])
    155156            cards += d,
     
    164165        url = self.REQUEST.get('URL1')
    165166        return self.REQUEST.RESPONSE.redirect(url)
    166    
     167
    167168    security.declareProtected(ModifyPortalContent,"archiveBatch") ###(
    168169    def archiveBatch(self,delete=False):
Note: See TracChangeset for help on using the changeset viewer.