clean up unused SetRole() in 000-functions
[plcapi.git] / PLC / Methods / AddTagType.py
index 0003085..cec8ba5 100644 (file)
@@ -1,10 +1,6 @@
-# $Id$
 #
 # Thierry Parmentelat - INRIA
 #
-# $Revision: 9423 $
-#
-
 
 from PLC.Faults import *
 from PLC.Method import Method
@@ -12,8 +8,8 @@ from PLC.Parameter import Parameter, Mixed
 from PLC.TagTypes import TagType, TagTypes
 from PLC.Auth import Auth
 
-can_update = lambda (field, value): field in \
-             ['tagname', 'description', 'category', 'min_role_id']
+can_update = lambda field_value: field_value[0] in \
+             ['tagname', 'description', 'category']
 
 class AddTagType(Method):
     """
@@ -26,7 +22,7 @@ class AddTagType(Method):
 
     roles = ['admin']
 
-    tag_type_fields = dict(filter(can_update, TagType.fields.items()))
+    tag_type_fields = dict(list(filter(can_update, list(TagType.fields.items()))))
 
     accepts = [
         Auth(),
@@ -37,10 +33,10 @@ class AddTagType(Method):
 
 
     def call(self, auth, tag_type_fields):
-        tag_type_fields = dict(filter(can_update, tag_type_fields.items()))
+        tag_type_fields = dict(list(filter(can_update, list(tag_type_fields.items()))))
         tag_type = TagType(self.api, tag_type_fields)
         tag_type.sync()
 
-       self.object_ids = [tag_type['tag_type_id']]
+        self.object_ids = [tag_type['tag_type_id']]
 
         return tag_type['tag_type_id']