Ignore:
Timestamp:
14 Jul 2024, 22:09:18 (5 months ago)
Author:
Henrik Bettermann
Message:

Two lga keys are wrong.

Location:
main/waeup.uniben/trunk/src/waeup/uniben/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/students/export.py

    r17835 r17849  
    222222
    223223    def mangle_value(self, value, name, context=None):
    224         if name == 'lg_state' and context.lga:
    225             value = context.lga.split('_')[0]
    226         if name == 'lg_area' and context.lga:
    227             value = '-'.join(context.lga.split('_')[1:])
     224        if name in ('lg_state', 'lg_area') and context.lga:
     225            value = context.lga
     226            if value.startswith('cross_river') or value.startswith('akwa_ibom'):
     227                value = context.lga.replace('_', '-', 1)
     228            if name == 'lg_state':
     229                value = value.split('_')[0]
     230            if name == 'lg_area':
     231                value = '-'.join(value.split('_')[1:])
    228232        return super(
    229233            NYSCExporter, self).mangle_value(
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_export.py

    r17835 r17849  
    179179        self.student.nysc = True
    180180        self.student.nysc_processed = False
    181         self.student.lga = u'xyz_abc'
     181        self.student.lga = u'cross_river_abc'
    182182        exporter = NYSCExporter()
    183183        exporter.export_all(self.app, self.outfile)
     
    189189            'entry_session,faccode,depcode,certcode,'
    190190            'nysc_senate_info,nysc_date_of_graduation,nysc_updated,nysc_processed,%s\r\n'
    191             'A111111,234,123,Anna,M.,Tester,f,NG,1981-02-04#,created,xyz,abc,ug_ft,'
     191            'A111111,234,123,Anna,M.,Tester,f,NG,1981-02-04#,created,cross-river,abc,ug_ft,'
    192192            'CERT1,NA,NA,200,2012,0,2010,NA,NA,CERT1,,,,0,,,,,,12.12,,,,,,\r\n' % year_range_str,
    193193            result
Note: See TracChangeset for help on using the changeset viewer.