- - removed anything having to do with event_type/event_object
[plcapi.git] / PLC / Methods / AddPersonToSlice.py
index c60b5fd..bd16e04 100644 (file)
@@ -3,7 +3,7 @@ from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
 from PLC.Persons import Person, Persons
 from PLC.Slices import Slice, Slices
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
 
 class AddPersonToSlice(Method):
     """
@@ -16,7 +16,7 @@ class AddPersonToSlice(Method):
     roles = ['admin', 'pi']
 
     accepts = [
-        PasswordAuth(),
+        Auth(),
         Mixed(Person.fields['person_id'],
               Person.fields['email']),
         Mixed(Slice.fields['slice_id'],
@@ -24,9 +24,6 @@ class AddPersonToSlice(Method):
         ]
 
     returns = Parameter(int, '1 if successful')
-    event_type = 'AddTo'
-    object_type = 'Slice'
-    object_ids = []
 
     def call(self, auth, person_id_or_email, slice_id_or_name):
         # Get account information
@@ -34,14 +31,14 @@ class AddPersonToSlice(Method):
         if not persons:
             raise PLCInvalidArgument, "No such account"
 
-        person = persons.values()[0]
+        person = persons[0]
 
         # Get slice information
         slices = Slices(self.api, [slice_id_or_name])
         if not slices:
             raise PLCInvalidArgument, "No such slice"
 
-        slice = slices.values()[0]
+        slice = slices[0]
 
         # If we are not admin, make sure the caller is a PI
         # of the site associated with the slice