Changeset 6854 for main/waeup.sirp/trunk
- Timestamp:
- 3 Oct 2011, 11:30:01 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/batching.py
r6849 r6854 46 46 47 47 def checkHeaders(self, headerfields, mode='create'): 48 if not 'reg_number' in headerfields and not 'student_id' in headerfields and not 'matric_number' in headerfields: 49 raise FatalCSVError( 50 "Need at least columns student_id or reg_number or matric_number for import!") 48 if not 'reg_number' in headerfields and not 'student_id' \ 49 in headerfields and not 'matric_number' in headerfields: 50 raise FatalCSVError( 51 "Need at least columns student_id or reg_number " + 52 "or matric_number for import!") 51 53 if mode == 'create': 52 54 for field in self.required_fields: … … 125 127 raw_header = reader.next() 126 128 for num, field in enumerate(headerfields): 127 if field not in ['student_id', 'reg_number', 'matric_number'] and mode == 'remove': 129 if field not in [ 130 'student_id', 'reg_number', 'matric_number'] and mode == 'remove': 128 131 continue 129 132 if field == u'--IGNORE--': … … 173 176 174 177 def checkHeaders(self, headerfields, mode='ignore'): 175 if not 'reg_number' in headerfields and not 'student_id' in headerfields and not 'matric_number' in headerfields: 176 raise FatalCSVError( 177 "Need at least columns student_id or reg_number or matric_number for import!") 178 if not 'reg_number' in headerfields and not 'student_id' \ 179 in headerfields and not 'matric_number' in headerfields: 180 raise FatalCSVError( 181 "Need at least columns student_id " + 182 "or reg_number or matric_number for import!") 178 183 # Check for fields to be ignored... 179 184 not_ignored_fields = [x for x in headerfields
Note: See TracChangeset for help on using the changeset viewer.