switch from sa/ma to authority, fix update_membership_list
[sfa.git] / geni / methods / update.py
index 5a0bfa6..1f2788d 100644 (file)
@@ -34,7 +34,7 @@ class update(Method):
     returns = Parameter(int, "1 if successful")
     
     def call(self, cred, record_dict):
-        self.api.auth.decode_authentication(cred, "update")
+        self.api.auth.check(cred, "update")
         record = GeniRecord(dict = record_dict)
         type = record.get_type()
         self.api.auth.verify_object_permission(record.get_name())
@@ -59,7 +59,7 @@ class update(Method):
 
         # update the PLC information that was specified with the record
 
-        if (type == "sa") or (type == "ma"):
+        if (type == "authority"):
             self.api.plshell.UpdateSite(self.api.plauth, pointer, record.get_pl_info())
 
         elif type == "slice":
@@ -78,13 +78,13 @@ class update(Method):
                     update_fields[key] = all_fields[key]
             self.api.plshell.UpdatePerson(self.api.plauth, pointer, update_fields)
 
-         elif type == "node":
+        elif type == "node":
             self.api.plshell.UpdateNode(self.api.plauth, pointer, record.get_pl_info())
 
         else:
             raise UnknownGeniType(type)
 
-        # update membership for researchers, pis, owners, operators^M
+        # update membership for researchers, pis, owners, operators
         self.api.update_membership(existing_record, record)
 
-        return 1    
+        return 1