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:06:15 -0700 |
| commit | 2a45086debb372a1e254efa98aee4da8ba495827 (patch) | |
| tree | 79492a304799efe1450a0214dad1cee2883f93aa | |
| parent | ec2f0417364050aed3e8c2aa1948915d08c39514 (diff) | |
[1.7.x] 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): """ |
