Do not lint migrations on dry_run

If the migration file is not generated, we're not able yet to generate the associated SQL.
That'll come in a later version :)
This commit is contained in:
David Wobrock committed 2020-07-02 19:15:30 +02:00
1 parent 6e8df8fb66
commit bf790a0591
1 file changed
+3
@@ -30,11 +30,14 @@ class Command(MakeMigrationsCommand):
def write_migration_files(self, changes): def write_migration_files(self, changes):
super(Command, self).write_migration_files(changes) super(Command, self).write_migration_files(changes)
if ( if (
not getattr(settings, "MIGRATION_LINTER_OVERRIDE_MAKEMIGRATIONS", False) not getattr(settings, "MIGRATION_LINTER_OVERRIDE_MAKEMIGRATIONS", False)
and not self.lint and not self.lint
): ):
return return
if self.dry_run:
return
# Lint migrations # Lint migrations
linter = MigrationLinter( linter = MigrationLinter(