From 2a45086debb372a1e254efa98aee4da8ba495827 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sun, 15 Jun 2014 11:05:40 -0700 Subject: [PATCH] [1.7.x] Improve error message for missing migrations in an app --- django/db/migrations/loader.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py index bb41c46be1..4d37cf080c 100644 --- a/django/db/migrations/loader.py +++ b/django/db/migrations/loader.py @@ -150,8 +150,11 @@ class MigrationLoader(object): # so we're fine. return if key[0] in self.migrated_apps: - return list(self.graph.root_nodes(key[0]))[0] - raise ValueError("Dependency on unknown app %s" % key[0]) + try: + return list(self.graph.root_nodes(key[0]))[0] + except IndexError: + raise ValueError("Dependency on app with no migrations: %s" % key[0]) + raise ValueError("Dependency on unknown app: %s" % key[0]) def build_graph(self): """