Ignore:
Timestamp:
30 Oct 2012, 17:31:43 (12 years ago)
Author:
Henrik Bettermann
Message:

We need to import old scratch card payments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py

    r9421 r9467  
    679679        # by Excel or Calc
    680680        p_id = p_id.strip('#')
    681         if not p_id.startswith('p'):
     681        if len(p_id.split('-')) != 3 and not p_id.startswith('p'):
    682682            # For data migration from old SRP only
    683683            p_id = 'p' + p_id[7:] + '0'
     
    699699        parent = self.getParent(row, site)
    700700        p_id = row['p_id'].strip('#')
    701         if not p_id.startswith('p'):
     701        if len(p_id.split('-')) != 3 and not p_id.startswith('p'):
    702702            # For data migration from old SRP
    703703            obj.p_id = 'p' + p_id[7:] + '0'
     
    736736                errs.append(('p_id','invalid length'))
    737737                return errs, inv_errs, conv_dict
     738        elif len(p_id.split('-')) == 3:
     739            # The SRP used either pins as keys ...
     740            if len(p_id.split('-')[2]) != 10:
     741                errs.append(('p_id','invalid pin'))
     742                return errs, inv_errs, conv_dict
    738743        else:
     744            # ... or order_ids.
    739745            if not len(p_id) == 19:
    740746                errs.append(('p_id','invalid length'))
Note: See TracChangeset for help on using the changeset viewer.