Skip to content

Commit

Permalink
Fixing using QuerySet.iterator() after prefetch_related() without spe…
Browse files Browse the repository at this point in the history
…cifying chunk_size is deprecated
  • Loading branch information
John Westcott IV authored and john-westcott-iv committed May 8, 2023
1 parent a72f126 commit efe19ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion awx/main/migrations/_OrgAdmin_to_use_ig.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
def migrate_org_admin_to_use(apps, schema_editor):
logger.info('Initiated migration from Org admin to use role')
roles_added = 0
for org in Organization.objects.prefetch_related('admin_role__members').iterator():
for org in Organization.objects.prefetch_related('admin_role__members').iterator(chunk_size=1000):
igs = list(org.instance_groups.all())
if not igs:
continue
Expand Down

0 comments on commit efe19ea

Please sign in to comment.