diff --git a/django/core/management/commands/sqlmigrate.py b/django/core/management/commands/sqlmigrate.py index aee793fc14..f687360fb4 100644 --- a/django/core/management/commands/sqlmigrate.py +++ b/django/core/management/commands/sqlmigrate.py @@ -32,7 +32,7 @@ class Command(BaseCommand): # Get the database we're operating from connection = connections[options['database']] - # Load up an loader to get all the migration data, but don't replace + # Load up a loader to get all the migration data, but don't replace # migrations. loader = MigrationLoader(connection, replace_migrations=False) diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py index eb370164f3..c0837140af 100644 --- a/django/db/migrations/loader.py +++ b/django/db/migrations/loader.py @@ -149,7 +149,10 @@ class MigrationLoader: "There is more than one migration for '%s' with the prefix '%s'" % (app_label, name_prefix) ) elif not results: - raise KeyError("There no migrations for '%s' with the prefix '%s'" % (app_label, name_prefix)) + raise KeyError( + f"There is no migration for '{app_label}' with the prefix " + f"'{name_prefix}'" + ) else: return self.disk_migrations[results[0]] diff --git a/tests/migrations/test_loader.py b/tests/migrations/test_loader.py index 1e0608f58c..3c4f44aa5e 100644 --- a/tests/migrations/test_loader.py +++ b/tests/migrations/test_loader.py @@ -182,7 +182,7 @@ class LoaderTests(TestCase): msg = "There is more than one migration for 'migrations' with the prefix '0'" with self.assertRaisesMessage(AmbiguityError, msg): migration_loader.get_migration_by_prefix("migrations", "0") - msg = "There no migrations for 'migrations' with the prefix 'blarg'" + msg = "There is no migration for 'migrations' with the prefix 'blarg'" with self.assertRaisesMessage(KeyError, msg): migration_loader.get_migration_by_prefix("migrations", "blarg") @@ -299,7 +299,7 @@ class LoaderTests(TestCase): loader.build_graph() self.assertEqual(num_nodes(), 3) - # Starting at 5 to 7 we are passed the squashed migrations + # Starting at 5 to 7 we are past the squashed migrations. self.record_applied(recorder, 'migrations', '5_auto') loader.build_graph() self.assertEqual(num_nodes(), 2)