- Timestamp:
- 18 Apr 2012, 05:12:32 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
r8176 r8202 34 34 from waeup.kofa.interfaces import ( 35 35 IBatchProcessor, FatalCSVError, IObjectConverter, IUserAccount, 36 IObjectHistory, VALIDATED )36 IObjectHistory, VALIDATED, DELETIONMARKER) 37 37 from waeup.kofa.interfaces import MessageFactory as _ 38 38 from waeup.kofa.students.interfaces import ( … … 168 168 history.addMessage(msg) 169 169 elif hasattr(obj, key): 170 setattr(obj, key, value) 170 # Set attribute to None if value is marked for deletion 171 if value == DELETIONMARKER: 172 setattr(obj, key, None) 173 elif value is not None: 174 setattr(obj, key, value) 171 175 items_changed += '%s=%s, ' % (key,value) 172 176 parent = self.getParent(row, site) … … 296 300 # Skip fields not declared in interface. 297 301 if hasattr(obj, key): 298 setattr(obj, key, value) 299 if key == 'certificate': 300 value = value.code 302 # Set attribute to None if value is marked for deletion 303 if value == DELETIONMARKER: 304 setattr(obj, key, None) 305 elif value is not None: 306 setattr(obj, key, value) 307 if key == 'certificate': 308 value = value.code 301 309 items_changed += '%s=%s, ' % (key,value) 302 310 parent = self.getParent(row, site) … … 687 695 if hasattr(obj, key) and not key in [ 688 696 'current_session','current_level']: 689 setattr(obj, key, value) 697 # Set attribute to None if value is marked for deletion 698 if value == DELETIONMARKER: 699 setattr(obj, key, None) 700 elif value is not None: 701 setattr(obj, key, value) 690 702 items_changed += '%s=%s, ' % (key,value) 691 703 parent = self.getParent(row, site)
Note: See TracChangeset for help on using the changeset viewer.