svn keywords
[plcapi.git] / PLC / Methods / AddPerson.py
index ea9e84a..99f634c 100644 (file)
@@ -1,3 +1,5 @@
+# $Id$
+# $URL$
 from PLC.Faults import *
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
@@ -14,7 +16,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,14 +32,14 @@ class AddPerson(Method):
 
     returns = Parameter(int, 'New person_id (> 0) if successful')
 
-
     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()
 
        # Logging variables
-       self.object_ids = [person['person_id']]
+       self.event_objects = {'Person': [person['person_id']]}
        self.message = 'Person %d added' % person['person_id']  
 
         return person['person_id']