mirror of
https://github.com/ansible/awx.git
synced 2026-05-12 20:07:37 -02:30
Fix migration order of operations bug
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|
||||||
# AWX migration utils
|
# AWX migration utils
|
||||||
from awx.main.migrations._rbac import delete_all_custom_script_roles
|
|
||||||
from awx.main.migrations._inventory_source import delete_custom_inv_source
|
from awx.main.migrations._inventory_source import delete_custom_inv_source
|
||||||
|
|
||||||
|
|
||||||
@@ -15,5 +14,4 @@ class Migration(migrations.Migration):
|
|||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.RunPython(delete_custom_inv_source),
|
migrations.RunPython(delete_custom_inv_source),
|
||||||
migrations.RunPython(delete_all_custom_script_roles),
|
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
from awx.main.migrations._rbac import delete_all_custom_script_roles
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
@@ -78,4 +80,5 @@ class Migration(migrations.Migration):
|
|||||||
model_name='custominventoryscript',
|
model_name='custominventoryscript',
|
||||||
name='read_role',
|
name='read_role',
|
||||||
),
|
),
|
||||||
|
migrations.RunPython(delete_all_custom_script_roles),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ def delete_all_custom_script_roles(apps, schema_editor):
|
|||||||
role.delete()
|
role.delete()
|
||||||
role_ct += 1
|
role_ct += 1
|
||||||
if role_ct:
|
if role_ct:
|
||||||
logger.debug('Deleted roles corresponding to custom inventory sources.')
|
logger.debug('Deleted {} roles corresponding to custom inventory sources.'.format(role_ct))
|
||||||
|
|
||||||
|
|
||||||
UNIFIED_ORG_LOOKUPS = {
|
UNIFIED_ORG_LOOKUPS = {
|
||||||
|
|||||||
Reference in New Issue
Block a user