summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2015-02-28 10:12:32 +0100
committerClaude Paroz <claude@2xlibre.net>2015-02-28 10:12:32 +0100
commit9f1dbe29c0dbae57ff7950f3f64a0d083177cca8 (patch)
treed6830483811f89999f1bdda24e34106c7cabf2c4
parent3cf1c02695481900cf6140f54beb48f0e7d88e19 (diff)
Fixed #24369 -- Prevented crash when `flush`ing before db migration
Thanks Thomas Tanner for the report.
-rw-r--r--django/core/management/commands/flush.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/core/management/commands/flush.py b/django/core/management/commands/flush.py
index 97c94501c4..eceb873c51 100644
--- a/django/core/management/commands/flush.py
+++ b/django/core/management/commands/flush.py
@@ -46,6 +46,10 @@ class Command(BaseCommand):
sql_list = sql_flush(self.style, connection, only_django=True,
reset_sequences=reset_sequences,
allow_cascade=allow_cascade)
+ if not sql_list:
+ raise CommandError(
+ "No commands to proceed with, maybe the database is still empty?"
+ )
if interactive:
confirm = input("""You have requested a flush of the database.