Changeset 9312 for main/waeup.kofa/trunk/src/waeup/kofa/authentication.py
- Timestamp:
- 8 Oct 2012, 07:54:23 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/authentication.py
r8973 r9312 37 37 IUserAccount, IAuthPluginUtility, IPasswordValidator, 38 38 IKofaPrincipal, IKofaPrincipalInfo, IKofaPluggable, 39 IBatchProcessor )39 IBatchProcessor, IGNORE_MARKER) 40 40 from waeup.kofa.utils.batching import BatchProcessor 41 41 … … 420 420 return 421 421 422 def updateEntry(self, obj, row, site): 423 """Update obj to the values given in row. 424 """ 425 changed = [] 426 for key, value in row.items(): 427 if key == 'roles': 428 # We cannot simply set the roles attribute here because 429 # we can't assure that the name attribute is set before 430 # the roles attribute is set. 431 continue 432 # Skip fields to be ignored. 433 if value == IGNORE_MARKER: 434 continue 435 if not hasattr(obj, key): 436 continue 437 setattr(obj, key, value) 438 changed.append('%s=%s' % (key, value)) 439 roles = row.get('roles', IGNORE_MARKER) 440 if roles not in ('', IGNORE_MARKER): 441 evalvalue = eval(roles) 442 if isinstance(evalvalue, list): 443 setattr(obj, 'roles', evalvalue) 444 changed.append('roles=%s' % roles) 445 # Log actions... 446 items_changed = ', '.join(changed) 447 grok.getSite().logger.info('%s - %s - User updated: %s' 448 % (self.name, row['name'], items_changed)) 449 return 422 450 423 451 class UsersPlugin(grok.GlobalUtility):
Note: See TracChangeset for help on using the changeset viewer.