git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
no change, just nicer php
[plcapi.git]
/
PLC
/
Methods
/
AddRoleToTagType.py
diff --git
a/PLC/Methods/AddRoleToTagType.py
b/PLC/Methods/AddRoleToTagType.py
index
947adcd
..
cb2e9f2
100644
(file)
--- a/
PLC/Methods/AddRoleToTagType.py
+++ b/
PLC/Methods/AddRoleToTagType.py
@@
-31,13
+31,13
@@
class AddRoleToTagType(Method):
# Get role
roles = Roles(self.api, [role_id_or_name])
if not roles:
# Get role
roles = Roles(self.api, [role_id_or_name])
if not roles:
- raise PLCInvalidArgument
, "Invalid role '%s'" % unicode(role_id_or_name
)
+ raise PLCInvalidArgument
("Invalid role '%s'" % str(role_id_or_name)
)
role = roles[0]
# Get subject tag type
tag_types = TagTypes(self.api, [tag_type_id_or_tagname])
if not tag_types:
role = roles[0]
# Get subject tag type
tag_types = TagTypes(self.api, [tag_type_id_or_tagname])
if not tag_types:
- raise PLCInvalidArgument
, "No such tag type"
+ raise PLCInvalidArgument
("No such tag type")
tag_type = tag_types[0]
# Authenticated function
tag_type = tag_types[0]
# Authenticated function
@@
-45,7
+45,7
@@
class AddRoleToTagType(Method):
# Only admins
if 'admin' not in self.caller['roles']:
# Only admins
if 'admin' not in self.caller['roles']:
- raise PLCInvalidArgument
, "Not allowed to grant that role"
+ raise PLCInvalidArgument
("Not allowed to grant that role")
if role['role_id'] not in tag_type['role_ids']:
tag_type.add_role(role)
if role['role_id'] not in tag_type['role_ids']:
tag_type.add_role(role)