Changeset 9312 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 8 Oct 2012, 07:54:23 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 3 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): -
main/waeup.kofa/trunk/src/waeup/kofa/browser/batchprocessing.txt
r9310 r9312 23 23 >>> from waeup.kofa.app import University 24 24 >>> getRootFolder()['app'] = University() 25 >>> from zope.component.hooks import setSite 26 >>> setSite(getRootFolder()['app']) 25 27 26 28 Create a datacenter storage path: … … 493 495 >>> henrik = getRootFolder()['app']['users']['henrik'] 494 496 >>> henrik.roles 495 ['waeup.PortalManager', 'waeup. ImportManager']497 ['waeup.PortalManager', 'waeup.AcademicsOfficer', 'waeup.ImportManager'] 496 498 497 499 Pending files -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/batching.py
r9307 r9312 75 75 evalvalue = eval(value) 76 76 if isinstance(evalvalue, list): 77 value = eval (value)77 value = evalvalue 78 78 except: 79 79 pass
Note: See TracChangeset for help on using the changeset viewer.