+# $Id$
import random
import base64
import time
# Get account information
persons = Persons(self.api, [person_id_or_email])
if not persons:
- raise PLCInvalidArgument, "No such account"
+ raise PLCInvalidArgument, "No such account %r"%person_id_or_email
person = persons[0]
if person['peer_id'] is not None:
- raise PLCInvalidArgument, "Not a local account"
+ raise PLCInvalidArgument, "Not a local account %r"%person_id_or_email
if person['enabled']:
- raise PLCInvalidArgument, "Account must be new (disabled)"
+ raise PLCInvalidArgument, "Account %r must be new (disabled)"%person_id_or_email
# Get the primary site name
person_sites = Sites(self.api, person['site_ids'])
for site in person_sites:
person_ids.update(site['person_ids'])
persons = Persons(self.api, person_ids)
- pis = filter(lambda person: 'pi' in person['roles'], persons)
+ pis = filter(lambda person: 'pi' in person['roles'] and person['enabled'], persons)
# Send e-mail to PI(s) and copy the user
To = [("%s %s" % (pi['first_name'], pi['last_name']), pi['email']) for pi in pis]
print >> log, "Warning: No message template '%s'" % message_id
# Logging variables
- self.object_ids = [person['person_id']]
+ self.event_objects = {'Person': [person['person_id']]}
self.message = message_id
if verification_key is not None and person['verification_expires'] and \