provide utility view for fixing person roles (set to 'loops.Person')
This commit is contained in:
		
							parent
							
								
									1cec746423
								
							
						
					
					
						commit
						bc0949842e
					
				
					 2 changed files with 20 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -152,4 +152,12 @@
 | 
			
		|||
      permission="zope.ManageServices"
 | 
			
		||||
      menu="zmi_views" title="Prefix" />
 | 
			
		||||
 | 
			
		||||
  <!-- utilities -->
 | 
			
		||||
 | 
			
		||||
  <browser:page
 | 
			
		||||
      for="loops.interfaces.ILoops"
 | 
			
		||||
      name="fix_person_roles"
 | 
			
		||||
      class="loops.organize.browser.member.FixPersonRoles"
 | 
			
		||||
      permission="zope.ManageServices" />
 | 
			
		||||
 | 
			
		||||
</configure>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -500,3 +500,15 @@ class PasswordReset(PasswordChange):
 | 
			
		|||
        mailhost = component.getUtility(IMailDelivery, 'Mail')
 | 
			
		||||
        mailhost.send(sender, recipients, msg.as_string())
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class FixPersonRoles(object):
 | 
			
		||||
 | 
			
		||||
    def __call__(self):
 | 
			
		||||
        concepts = self.context['concepts']
 | 
			
		||||
        for p in concepts['person'].getChildren([concepts['hasType']]):
 | 
			
		||||
            person = adapted(p)
 | 
			
		||||
            userId = person.userId
 | 
			
		||||
            print '***', userId
 | 
			
		||||
            person.userId = userId
 | 
			
		||||
        return 'blubb'
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue