X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FAddPerson.py;h=bd634cbeea59b64cf8bb0f58130f351756215b27;hb=2cff66789332935b816d21e4bf433b83218635df;hp=ea9e84a2e811782d4ccb64de6ce58e69ae71ef6e;hpb=dd6f6871abdf5412d908dc31777ce88b09192efe;p=plcapi.git diff --git a/PLC/Methods/AddPerson.py b/PLC/Methods/AddPerson.py index ea9e84a..bd634cb 100644 --- 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 - SetPersonEnabled() or UpdatePerson(). + UpdatePerson(). Returns the new person_id (> 0) if successful, faults otherwise. """ @@ -30,9 +30,12 @@ class AddPerson(Method): returns = Parameter(int, 'New person_id (> 0) if successful') + object_type = 'Person' + 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()