from PLC.Parameter import Parameter, Mixed
from PLC.Keys import Key, Keys
from PLC.Persons import Person, Persons
from PLC.Parameter import Parameter, Mixed
from PLC.Keys import Key, Keys
from PLC.Persons import Person, Persons
def call(self, auth, person_id_or_email, key_fields):
key_fields = dict(filter(can_update, key_fields.items()))
# Get account details
def call(self, auth, person_id_or_email, key_fields):
key_fields = dict(filter(can_update, key_fields.items()))
# Get account details
# If we are not admin, make sure caller is adding a key to their account
if 'admin' not in self.caller['roles']:
if person['person_id'] != self.caller['person_id']:
# If we are not admin, make sure caller is adding a key to their account
if 'admin' not in self.caller['roles']:
if person['person_id'] != self.caller['person_id']:
- self.object_ids = [person['person_id'], key['key_id']]
+ # Logging variables
+ self.object_ids = [person['person_id'], key['key_id']]
+ self.message = 'Key %d added to person %d' % \
+ (key['key_id'], person['person_id'])