1
0
mirror of https://github.com/django/django.git synced 2025-03-31 19:46:42 +00:00

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 c755c8daa2
commit 1e5c01c26e

View File

@ -150,8 +150,11 @@ class MigrationLoader(object):
# so we're fine. # so we're fine.
return return
if key[0] in self.migrated_apps: if key[0] in self.migrated_apps:
return list(self.graph.root_nodes(key[0]))[0] try:
raise ValueError("Dependency on unknown app %s" % key[0]) 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): def build_graph(self):
""" """