ensure manually modifying hosts adhears to license

* Super user or not, don't allow adding NOR editing (changing the name
of) a host to exceed the host license count.
This commit is contained in:
Chris Meyers
2017-01-26 12:10:20 -05:00
parent 7c4b77284e
commit e09a0fb886
3 changed files with 41 additions and 18 deletions

View File

@@ -1684,8 +1684,10 @@ class HostList(ListCreateAPIView):
class HostDetail(RetrieveUpdateDestroyAPIView):
always_allow_superuser = False
model = Host
serializer_class = HostSerializer
permission_classes = (HostPermission,)
class InventoryHostsList(SubListCreateAttachDetachAPIView):