X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FPersons.py;fp=PLC%2FPersons.py;h=8e483b3fb5cf9189a46b5b9b3a07450b3f0642eb;hb=5d80c8d9c8016143aaf74dfd3a7e0561f7538aad;hp=7a2e635a8fc2e84c63d04d79700f005d18069369;hpb=76bdf368d0d8dcd046476abe04392a73a0eaa6e0;p=plcapi.git diff --git a/PLC/Persons.py b/PLC/Persons.py index 7a2e635..8e483b3 100644 --- a/PLC/Persons.py +++ b/PLC/Persons.py @@ -4,7 +4,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id$ +# $Id: Persons.py,v 1.37 2007/06/14 16:26:01 tmack Exp $ # from types import StringTypes @@ -100,8 +100,15 @@ class Person(Row): if len(domain) < 2: raise invalid_email - conflicts = Persons(self.api, [email]) - for person in conflicts: + # check only against users on the same peer + if 'peer_id' in self: + namespace_peer_id = self['peer_id'] + else: + namespace_peer_id = None + + conflicts = Persons(self.api, {'email':email,'peer_id':namespace_peer_id}) + + for person in conflicts: if 'person_id' not in self or self['person_id'] != person['person_id']: raise PLCInvalidArgument, "E-mail address already in use"