mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 12:41:19 -03:30
Fix AC-758 where we weren't considering whether the license was expired when deciding to allow creating more hosts
This commit is contained in:
parent
36f094a8f8
commit
a098ef4381
@ -354,11 +354,14 @@ class HostAccess(BaseAccess):
|
||||
# but still go down *most* of the license code path.
|
||||
validation_info['free_instances'] = 99999999
|
||||
|
||||
if not validation_info.get('demo') and validation_info.get('time_remaining') < 0:
|
||||
raise PermissionDenied("license has expired")
|
||||
|
||||
if validation_info.get('free_instances', 0) > 0:
|
||||
# BOOKMARK
|
||||
return True
|
||||
instances = validation_info.get('available_instances', 0)
|
||||
raise PermissionDenied("license range of %s instances has been exceed" % instances)
|
||||
raise PermissionDenied("license range of %s instances has been exceeded" % instances)
|
||||
|
||||
def can_change(self, obj, data):
|
||||
# Prevent moving a host to a different inventory.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user