mirror of
https://github.com/ansible/awx.git
synced 2026-05-15 13:27:40 -02:30
Added a max_hosts field to Organization
in order to optionally set a limit to the number of hosts an organization that is sharing a license is allowed to manage. related #1542
This commit is contained in:
@@ -10,6 +10,7 @@ from django.db.models import Q
|
|||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.contrib.sessions.models import Session
|
from django.contrib.sessions.models import Session
|
||||||
from django.utils.timezone import now as tz_now
|
from django.utils.timezone import now as tz_now
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
@@ -42,6 +43,12 @@ class Organization(CommonModel, NotificationFieldsModel, ResourceMixin, CustomVi
|
|||||||
'InstanceGroup',
|
'InstanceGroup',
|
||||||
blank=True,
|
blank=True,
|
||||||
)
|
)
|
||||||
|
max_hosts = models.PositiveIntegerField(
|
||||||
|
blank=True,
|
||||||
|
default=0,
|
||||||
|
help_text=_('Maximum number of hosts allowed to be managed by this organization.'),
|
||||||
|
)
|
||||||
|
|
||||||
admin_role = ImplicitRoleField(
|
admin_role = ImplicitRoleField(
|
||||||
parent_role='singleton:' + ROLE_SINGLETON_SYSTEM_ADMINISTRATOR,
|
parent_role='singleton:' + ROLE_SINGLETON_SYSTEM_ADMINISTRATOR,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user