diff --git a/legacy/scripts/field_mappings.py b/legacy/scripts/field_mappings.py index 485db7165..3e397de6f 100644 --- a/legacy/scripts/field_mappings.py +++ b/legacy/scripts/field_mappings.py @@ -6,6 +6,10 @@ from collections import OrderedDict from migration_base import appconfs, legacy_app +def is_unannotated_field_line(line): + return not line.strip().startswith('#') and ' = ' in line and ' # ' not in line + + def is_field_line(line): return not line.strip().startswith('#') and ' = ' in line and ' # ' in line @@ -22,7 +26,7 @@ def print_commented_source(model): cols = max(map(len, [line for line in lines if is_field_line(line)])) print '\n' for line in lines: - if not is_field_line(line): + if not is_unannotated_field_line(line): print line.rstrip() else: print '%s # %s' % (line.rstrip().ljust(cols), new_to_old[get_field(line)])