mirror of
https://github.com/ansible/awx.git
synced 2026-06-27 09:28:01 -02:30
* Introduced in PR https://github.com/ansible/awx/pull/16058/changes then a later large merge from AAP back into devel removed the changes * This PR re-introduces the github app lookup migration rename tests with the migration names updated and the kind to namespace correction
27 lines
811 B
Python
27 lines
811 B
Python
from django.db import migrations
|
|
|
|
# AWX
|
|
from awx.main.models import CredentialType
|
|
from awx.main.utils.common import set_current_apps
|
|
|
|
|
|
def setup_tower_managed_defaults(apps, schema_editor):
|
|
set_current_apps(apps)
|
|
CredentialType.setup_tower_managed_defaults(apps)
|
|
|
|
|
|
def setup_rbac_role_system_administrator(apps, schema_editor):
|
|
Role = apps.get_model('main', 'Role')
|
|
Role.objects.get_or_create(singleton_name='system_administrator', role_field='system_administrator')
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
dependencies = [
|
|
('main', '0200_template_name_constraint'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(setup_tower_managed_defaults, migrations.RunPython.noop),
|
|
migrations.RunPython(setup_rbac_role_system_administrator, migrations.RunPython.noop),
|
|
]
|