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:
Jeff Bradberry 2019-02-06 10:14:46 -05:00
parent 658e5f0fc8
commit 5e13da62a4

View File

@ -10,6 +10,7 @@ from django.db.models import Q
from django.contrib.auth.models import User
from django.contrib.sessions.models import Session
from django.utils.timezone import now as tz_now
from django.utils.translation import ugettext_lazy as _
# AWX
@ -42,6 +43,12 @@ class Organization(CommonModel, NotificationFieldsModel, ResourceMixin, CustomVi
'InstanceGroup',
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(
parent_role='singleton:' + ROLE_SINGLETON_SYSTEM_ADMINISTRATOR,
)