'Fix newline courses in CSM!'

def handle(self, *args, **options):

    if (len(args) != 2):
        raise CommandError('Must    specify    start    and    end    dates:    e.g.    "2016-08-23    16:43:00"    "2016-08-24    22:00:00"')
    (start, end) = args
    dry_run = options['dry_run']
    log.info('Starting    fix_student_module_newlines    in    %s    mode!', ('dry_run' if dry_run else 'real'))
    rows_to_fix = use_read_replica_if_available(StudentModule.objects.raw('select    *    from    courseware_studentmodule    where    modified    between    %s    and    %s    and    course_id    like    %s', (start, end, '%\n')))
    results = [self.fix_row(row, dry_run=dry_run) for row in rows_to_fix]
    log.info('Finished    fix_student_module_newlines    in    %s    mode!', ('dry_run' if dry_run else 'real'))
    log.info('Stats:    %s    rows    detected', len(results))
    if results:
        aggregated_result = FixResult(*[sum(col) for col in zip(*results)])
        log.info('Results:    %s', aggregated_result)
