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
- added logging variable 'object_type'
[plcapi.git]
/
PLC
/
Methods
/
AddPerson.py
diff --git
a/PLC/Methods/AddPerson.py
b/PLC/Methods/AddPerson.py
index
11d9733
..
bd634cb
100644
(file)
--- a/
PLC/Methods/AddPerson.py
+++ b/
PLC/Methods/AddPerson.py
@@
-14,7
+14,7
@@
class AddPerson(Method):
used, otherwise defaults are used.
Accounts are disabled by default. To enable an account, use
used, otherwise defaults are used.
Accounts are disabled by default. To enable an account, use
-
SetPersonEnabled() or
UpdatePerson().
+ UpdatePerson().
Returns the new person_id (> 0) if successful, faults otherwise.
"""
Returns the new person_id (> 0) if successful, faults otherwise.
"""
@@
-30,15
+30,17
@@
class AddPerson(Method):
returns = Parameter(int, 'New person_id (> 0) if successful')
returns = Parameter(int, 'New person_id (> 0) if successful')
- event_type = 'Add'
object_type = 'Person'
object_type = 'Person'
- object_ids = []
+
def call(self, auth, person_fields):
person_fields = dict(filter(can_update, person_fields.items()))
def call(self, auth, person_fields):
person_fields = dict(filter(can_update, person_fields.items()))
+ person_fields['enabled'] = False
person = Person(self.api, person_fields)
person.sync()
person = Person(self.api, person_fields)
person.sync()
+ # Logging variables
self.object_ids = [person['person_id']]
self.object_ids = [person['person_id']]
+ self.message = 'Person %d added' % person['person_id']
return person['person_id']
return person['person_id']