[1.7.x] Improve error message for missing migrations in an app

This commit is contained in:
Andrew Godwin 2014-06-15 11:05:40 -07:00
parent ec2f041736
commit 2a45086deb
1 changed files with 5 additions and 2 deletions

View File

@ -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):
"""