Commit 0bc4f4e0 by Awais Jibran Committed by GitHub

Merge pull request #13357 from edx/aj/ECOM-5405-update-bulk-enroll-mgm

Update each enrollment in atomic transaction not all
parents 79085fff 896b3cb1
......@@ -91,9 +91,10 @@ class Command(BaseCommand):
if not commit:
logger.info('Dry run, changes have not been saved. Run again with "commit" argument to save changes')
raise Exception('The --commit flag was not given; forcing rollback.')
with transaction.atomic():
# call `change_mode` which will change the mode and also emit tracking event
for enrollment in course_enrollments:
with transaction.atomic():
enrollment.change_mode(mode=to_mode)
logger.info('Finished moving users from %s to %s in course %s.', from_mode, to_mode, course_key_str)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment