@cli.command()<EOL>@click.argument('<STR_LIT>', default='<STR_LIT>', type=click.File('<STR_LIT:r>'))<EOL>def fix(csvfile):
header('<STR_LIT>', csvfile.name)<EOL>bads = []<EOL>reader = csv.reader(csvfile)<EOL>reader.next()  <EOL>for id, _, sources, dests in reader:<EOL><INDENT>advice = Advice.objects.get(id=id)<EOL>sources = [s.strip() for s in sources.split('<STR_LIT:U+002C>') if s.strip()]<EOL>dests = [d.strip() for d in dests.split('<STR_LIT:U+002C>') if d.strip()]<EOL>if not len(sources) == len(dests):<EOL><INDENT>bads.append(id)<EOL>continue<EOL><DEDENT>for source, dest in zip(sources, dests):<EOL><INDENT>echo('<STR_LIT>', white(id), white(source), white(dest))<EOL>advice.subject = advice.subject.replace(source, dest)<EOL>advice.content = advice.content.replace(source, dest)<EOL><DEDENT>advice.save()<EOL>index(advice)<EOL><DEDENT>for id in bads:<EOL><INDENT>echo('<STR_LIT>', white(id))<EOL><DEDENT>success('<STR_LIT>')<EOL>
Apply a fix (ie. remove plain names)