mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 23:12:08 -03:30
Fix: do not use current apps in migrations (#15839)
This commit is contained in:
parent
8145de3917
commit
3495c421c1
@ -1,13 +1,12 @@
|
||||
import logging
|
||||
|
||||
from awx.main.models import Organization
|
||||
|
||||
logger = logging.getLogger('awx.main.migrations')
|
||||
|
||||
|
||||
def migrate_org_admin_to_use(apps, schema_editor):
|
||||
logger.info('Initiated migration from Org admin to use role')
|
||||
roles_added = 0
|
||||
Organization = apps.get_model('main', 'Organization')
|
||||
for org in Organization.objects.prefetch_related('admin_role__members').iterator(chunk_size=1000):
|
||||
igs = list(org.instance_groups.all())
|
||||
if not igs:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user