- Timestamp:
- 20 Nov 2012, 11:16:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
r9690 r9701 148 148 # We have to log this if state is provided. If not, 149 149 # logging is done by the event handler handle_student_added 150 if row.has_key('state'):150 if 'state' in row: 151 151 parent.logger.info('%s - Student record created' % obj.student_id) 152 152 history = IObjectHistory(obj) … … 191 191 192 192 # Remove student_id from row if empty 193 if row.has_key('student_id') and row['student_id'] in ( 194 None, IGNORE_MARKER): 193 if 'student_id' in row and row['student_id'] in (None, IGNORE_MARKER): 195 194 row.pop('student_id') 196 195 197 196 # Update password 198 # XXX: Ta le DELETION_MARKER into consideration199 if row.has_key('password'):197 # XXX: Take DELETION_MARKER into consideration 198 if 'password' in row: 200 199 passwd = row.get('password', IGNORE_MARKER) 201 200 if passwd not in ('', IGNORE_MARKER): … … 210 209 211 210 # Update registration state 212 if row.has_key('state'):211 if 'state' in row: 213 212 state = row.get('state', IGNORE_MARKER) 214 213 if state not in (IGNORE_MARKER, ''): … … 221 220 row.pop('state') 222 221 223 if row.has_key('transition'):222 if 'transition' in row: 224 223 transition = row.get('transition', IGNORE_MARKER) 225 224 if transition not in (IGNORE_MARKER, ''): … … 274 273 errs, inv_errs, conv_dict = converter.fromStringDict( 275 274 row, self.factory_name, mode=mode) 276 if row.has_key('transition'):275 if 'transition' in row: 277 276 if row['transition'] not in IMPORTABLE_TRANSITIONS: 278 277 if row['transition'] not in (IGNORE_MARKER, ''): 279 278 errs.append(('transition','not allowed')) 280 if row.has_key('state'):279 if 'state' in row: 281 280 if row['state'] not in IMPORTABLE_STATES: 282 281 if row['state'] not in (IGNORE_MARKER, ''): … … 438 437 StudentStudyCourseProcessor, self).checkConversion(row, mode=mode) 439 438 # We have to check if current_level is in range of certificate. 440 if conv_dict.has_key('certificate') and \ 441 conv_dict.has_key('current_level'): 439 if 'certificate' in conv_dict and 'current_level' in conv_dict: 442 440 cert = conv_dict['certificate'] 443 441 level = conv_dict['current_level']
Note: See TracChangeset for help on using the changeset viewer.