#NEWLINE# def remove_old_skill_names( apps , schema_editor ) : #NEWLINE# #INDENT# 'Remove legacy instances of Lesson named after skills.' #NEWLINE# Lesson = apps . get_model ( 'workshops' , 'Lesson' ) #NEWLINE# for ( old_name , new_names ) in TRANSLATE_NAMES . items ( ) : #NEWLINE# #INDENT# if Lesson : #NEWLINE# #INDENT# Lesson . objects . filter ( name = old_name ) . delete ( ) #NEWLINE# #UNINDENT# #UNINDENT# for old_name in EXTRA_LEGACY_NAMES : #NEWLINE# #INDENT# Lesson . objects . filter ( name = old_name ) . delete ( )