Changeset 8225


Ignore:
Timestamp:
19 Apr 2012, 20:02:24 (13 years ago)
Author:
uli
Message:

Fix StudyLevelImporter?.

File:
1 edited

Legend:

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

    r8221 r8225  
    261261
    262262    def getParent(self, row, site):
     263        NON_VALUES = ['', IGNORE_MARKER]
    263264        if not 'students' in site.keys():
    264265            return None
    265         if 'student_id' in row.keys() and row['student_id']:
     266        if row.get('student_id', '') not in NON_VALUES:
    266267            if row['student_id'] in site['students']:
    267268                student = site['students'][row['student_id']]
    268269                return student
    269         elif 'reg_number' in row.keys() and row['reg_number']:
     270        elif row.get('reg_number', '') not in NON_VALUES:
    270271            reg_number = row['reg_number']
    271272            cat = queryUtility(ICatalog, name='students_catalog')
     
    274275            if results:
    275276                return results[0]
    276         elif 'matric_number' in row.keys() and row['matric_number']:
     277        elif row.get('matric_number', '') not in NON_VALUES:
    277278            matric_number = row['matric_number']
    278279            cat = queryUtility(ICatalog, name='students_catalog')
Note: See TracChangeset for help on using the changeset viewer.