retrieve tag_type needed for caller_may_write_tag
[plcapi.git] / PLC / Methods / DeleteSliceTag.py
index e9cb134..6e62aa9 100644 (file)
@@ -10,6 +10,9 @@ from PLC.SliceTags import SliceTag, SliceTags
 from PLC.Slices import Slice, Slices
 from PLC.Nodes import Node, Nodes
 
+# need to import so the core classes get decorated with caller_may_write_tag
+from PLC.AuthorizeHelpers import AuthorizeHelpers
+
 class DeleteSliceTag(Method):
     """
     Deletes the specified slice or sliver attribute.
@@ -38,6 +41,9 @@ class DeleteSliceTag(Method):
             raise PLCInvalidArgument, "No such slice attribute"
         slice_tag = slice_tags[0]
 
+        tag_type_id = node_tag['tag_type_id']
+        tag_type = TagTypes (self.api,[tag_type_id])[0]
+
         slices = Slices(self.api, [slice_tag['slice_id']])
         if not slices:
             raise PLCInvalidArgument, "No such slice %d"%slice_tag['slice_id']