From df8a66e504c21ed96ab4189f3d76250616a82e11 Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Mon, 11 Feb 2019 15:51:40 -0500 Subject: [PATCH] Correct the org limit check for changing hosts to use the host's org instead of an inventory passed in from the user data, which is not allowed. --- awx/main/access.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/main/access.py b/awx/main/access.py index e5edac1b04..89c55b5ee1 100644 --- a/awx/main/access.py +++ b/awx/main/access.py @@ -876,7 +876,8 @@ class HostAccess(BaseAccess): self.check_license(add_host_name=data['name']) # Check the per-org limit - self.check_org_host_limit(data, add_host_name=data['name']) + self.check_org_host_limit({'inventory': obj.inventory}, + add_host_name=data['name']) # Checks for admin or change permission on inventory, controls whether # the user can edit variable data.