mirror of
https://github.com/ansible/awx.git
synced 2026-01-21 06:28:01 -03:30
Merge pull request #3386 from jbradberry/org-limits-message
Update the error message when exceeding the organization hosts limit Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
commit
2e0d381f8f
@ -346,15 +346,19 @@ class BaseAccess(object):
|
||||
active_count = Host.objects.org_active_count(org.id)
|
||||
if active_count > org.max_hosts:
|
||||
raise PermissionDenied(
|
||||
_("Organization host limit of %s has been exceeded, %s hosts active.") %
|
||||
(org.max_hosts, active_count))
|
||||
_("You have already reached the maximum number of %s hosts"
|
||||
" allowed for your organization. Contact your System Administrator"
|
||||
" for assistance." % org.max_hosts)
|
||||
)
|
||||
|
||||
if add_host_name:
|
||||
host_exists = Host.objects.filter(inventory__organization=org.id, name=add_host_name).exists()
|
||||
if not host_exists and active_count == org.max_hosts:
|
||||
raise PermissionDenied(
|
||||
_("Organization host limit of %s would be exceeded, %s hosts active.") %
|
||||
(org.max_hosts, active_count))
|
||||
_("You have already reached the maximum number of %s hosts"
|
||||
" allowed for your organization. Contact your System Administrator"
|
||||
" for assistance." % org.max_hosts)
|
||||
)
|
||||
|
||||
def get_user_capabilities(self, obj, method_list=[], parent_obj=None, capabilities_cache={}):
|
||||
if obj is None:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user