====
[plcapi.git] / PLC / Methods / DeletePersonTag.py
index 9d49861..6b748d3 100644 (file)
@@ -6,8 +6,9 @@ from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
 from PLC.Auth import Auth
 
-from PLC.PersonTags import PersonTag, PersonTags
 from PLC.Persons import Person, Persons
+from PLC.TagTypes import TagType, TagTypes
+from PLC.PersonTags import PersonTag, PersonTags
 
 # need to import so the core classes get decorated with caller_may_write_tag
 from PLC.AuthorizeHelpers import AuthorizeHelpers
@@ -36,6 +37,9 @@ class DeletePersonTag(Method):
             raise PLCInvalidArgument, "No such person tag %r"%person_tag_id
         person_tag = person_tags[0]
 
+        tag_type_id = person_tag['tag_type_id']
+        tag_type = TagTypes (self.api,[tag_type_id])[0]
+
         persons = Persons (self.api, person_tag['person_id'])
         if not persons:
             raise PLCInvalidArgument, "No such person %d"%person_tag['person_id']