renumber_migrations: Strip trailing '.py' from migrations.

This fixes a bug when renumbering more than 1 migration at a time.
This commit is contained in:
Tim Abbott
2017-04-18 21:31:14 -07:00
parent c6cd7074ee
commit 6d9962851c

View File

@@ -38,7 +38,7 @@ def renumber_migration(conflicts, order, last_correct_migration):
new_name = conflicts[i-1].replace(conflicts[i-1][0:4], '00' + str(int(last_correct_migration[0:4]) + 1))
os.rename('zerver/migrations/' + conflicts[i-1], 'zerver/migrations/' + new_name)
last_correct_migration = new_name
last_correct_migration = new_name.replace('.py', '')
def resolve_conflicts(conflicts, files_list):
# type: (List[str], List[str]) -> None