'Update enrollments for a specific user identifier (email or username).'

def update_enrollments(self, identifier, enrollment_args, options, error_users, success_users):

    users = options[identifier].split(',')
    for identified_user in users:
        logger.info(identified_user)
        try:
            user_args = {identifier: identified_user}
            enrollment_args['user'] = User.objects.get(**user_args)
            enrollments = CourseEnrollment.objects.filter(**enrollment_args)
            with transaction.atomic():
                for enrollment in enrollments:
                    enrollment.update_enrollment(mode=options['to_mode'])
                    enrollment.save()
                if options['noop']:
                    raise RollbackException('Forced    rollback.')
        except RollbackException:
            success_users.append(identified_user)
            continue
        except Exception as exception:
            error_users.append((identified_user, exception))
            continue
        success_users.append(identified_user)
        logger.info('Updated    user    [%s]    to    mode    [%s]', identified_user, options['to_mode'])
