3 # Create/update the default administrator account (should be person_id 2).
7 admin = {'first_name': "Default",
8 'last_name': "Administrator",
9 'email': plc['root_user'],
10 'password': plc['root_password']}
12 persons = GetPersons(the_admin_id)
15 # AddPerson won't let you pass a person_id
16 person_id = AddPerson(admin)
17 if person_id != the_admin_id:
18 # Huh? Someone deleted the account manually from the database.
19 DeletePerson(person_id)
20 raise Exception("Someone deleted the \"%s %s\" account from the database!" %
21 (admin['first_name'], admin['last_name']))
22 UpdatePerson(person_id, {'enabled': True})
24 person_id = persons[0]['person_id']
25 UpdatePerson(person_id, admin)