diff options
| author | Andrew Godwin <andrew@aeracode.org> | 2014-06-15 11:05:40 -0700 |
|---|---|---|
| committer | Andrew Godwin <andrew@aeracode.org> | 2014-06-15 11:05:40 -0700 |
| commit | 1e5c01c26ec5c0f08901434004b790cb1d5fe5a5 (patch) | |
| tree | 0e341e19ded5aa33816431bbe29d7d0fead34c7c | |
| parent | c755c8daa2e05dcf21d4a1b47625fba1e72d7109 (diff) | |
Improve error message for missing migrations in an app
| -rw-r--r-- | django/db/migrations/loader.py | 7 |
1 files 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): """ |
