mirror of
https://github.com/ansible/awx.git
synced 2026-01-21 22:48:02 -03:30
Fix migration order of operations bug
This commit is contained in:
parent
5f39b6276d
commit
8241ebbc9a
@ -3,7 +3,6 @@
|
||||
from django.db import migrations
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
@ -15,5 +14,4 @@ class Migration(migrations.Migration):
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(delete_custom_inv_source),
|
||||
migrations.RunPython(delete_all_custom_script_roles),
|
||||
]
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
from awx.main.migrations._rbac import delete_all_custom_script_roles
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@ -78,4 +80,5 @@ class Migration(migrations.Migration):
|
||||
model_name='custominventoryscript',
|
||||
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_ct += 1
|
||||
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 = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user