git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge from HEAD. Signed off by tmack.
[plcapi.git]
/
PLC
/
Methods
/
AddPersonKey.py
diff --git
a/PLC/Methods/AddPersonKey.py
b/PLC/Methods/AddPersonKey.py
index
0bba3a1
..
aa4ed00
100644
(file)
--- a/
PLC/Methods/AddPersonKey.py
+++ b/
PLC/Methods/AddPersonKey.py
@@
-5,7
+5,7
@@
from PLC.Keys import Key, Keys
from PLC.Persons import Person, Persons
from PLC.Auth import Auth
from PLC.Persons import Person, Persons
from PLC.Auth import Auth
-can_update = lambda (field, value): field
not in ['key_id
']
+can_update = lambda (field, value): field
in ['key_type','key
']
class AddPersonKey(Method):
"""
class AddPersonKey(Method):
"""
@@
-29,9
+29,6
@@
class AddPersonKey(Method):
returns = Parameter(int, 'New key_id (> 0) if successful')
returns = Parameter(int, 'New key_id (> 0) if successful')
- object_type = 'Person'
-
-
def call(self, auth, person_id_or_email, key_fields):
key_fields = dict(filter(can_update, key_fields.items()))
def call(self, auth, person_id_or_email, key_fields):
key_fields = dict(filter(can_update, key_fields.items()))
@@
-54,7
+51,8
@@
class AddPersonKey(Method):
person.add_key(key, commit = True)
# Logging variables
person.add_key(key, commit = True)
# Logging variables
- self.object_ids = [person['person_id'], key['key_id']]
+ self.event_objects = {'Person': [person['person_id']],
+ 'Key': [key['key_id']]}
self.message = 'Key %d added to person %d' % \
(key['key_id'], person['person_id'])
self.message = 'Key %d added to person %d' % \
(key['key_id'], person['person_id'])