if there are two accounts with the same e-mail on a remote peer, use the one with...
authorAnil-Kumar Vengalil <Anil-Kumar.Vengalil@sophia.inria.fr>
Tue, 15 Sep 2009 15:37:57 +0000 (15:37 +0000)
committerAnil-Kumar Vengalil <Anil-Kumar.Vengalil@sophia.inria.fr>
Tue, 15 Sep 2009 15:37:57 +0000 (15:37 +0000)
sfa/plc/slices.py

index 1e486a5..c8905b0 100644 (file)
@@ -243,7 +243,11 @@ class Slices(SimpleStorage):
             if not person_record:
                 pass
             person_dict = person_record.as_dict()
-            persons = self.api.plshell.GetPersons(self.api.plauth, [person_dict['email']], ['person_id', 'key_ids'])
+           if peer:
+              peer_id=self.api.plshell.GetPeers(self.api.plauth, {'shortname' : peer}, ['peer_id'])[0]['peer_id']
+               persons = self.api.plshell.GetPersons(self.api.plauth, {'email' : [person_dict['email']], 'peer_id' : peer_id}, ['person_id', 'key_ids'])
+           else:
+               persons = self.api.plshell.GetPersons(self.api.plauth, [person_dict['email']], ['person_id', 'key_ids'])
 
             # Create the person record 
             if not persons: