summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaved Khan <javed@agiliq.com>2013-10-17 16:24:20 +0530
committerTim Graham <timograham@gmail.com>2013-10-17 08:21:17 -0400
commita921f0634583e2f87475e802e2674e7159b4f25b (patch)
treec264b4a0b7bc06e6a497b91c9c6897027a9385f7
parent7f508a36731660c8cd2659f23098f1379eaa8fb5 (diff)
Fixed #21280 -- Don't generate empty migration files
-rw-r--r--django/core/management/commands/makemigrations.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/core/management/commands/makemigrations.py b/django/core/management/commands/makemigrations.py
index e897bbdb9d..1079b4269c 100644
--- a/django/core/management/commands/makemigrations.py
+++ b/django/core/management/commands/makemigrations.py
@@ -82,5 +82,6 @@ class Command(BaseCommand):
open(init_path, "w").close()
# We just do this once per app
directory_created[app_label] = True
+ migration_string = writer.as_string()
with open(writer.path, "wb") as fh:
- fh.write(writer.as_string())
+ fh.write(migration_string)