summaryrefslogtreecommitdiff
path: root/django/db
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2014-06-16 09:58:35 -0700
committerAndrew Godwin <andrew@aeracode.org>2014-06-16 09:58:35 -0700
commit2b79be2beee8531ab1ef4efca75589705774d8f7 (patch)
tree0e84cc86b2806be7e91a27e6172a29356acaad52 /django/db
parentf047dd2f3eb15619c9137d3389b22e6914092f1c (diff)
Fixed #22848: Ignore no-migrations errors during makemigrations only
Diffstat (limited to 'django/db')
-rw-r--r--django/db/migrations/loader.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py
index 0d961c2b69..26047b3a85 100644
--- a/django/db/migrations/loader.py
+++ b/django/db/migrations/loader.py
@@ -39,10 +39,11 @@ class MigrationLoader(object):
in memory.
"""
- def __init__(self, connection, load=True):
+ def __init__(self, connection, load=True, ignore_no_migrations=False):
self.connection = connection
self.disk_migrations = None
self.applied_migrations = None
+ self.ignore_no_migrations = ignore_no_migrations
if load:
self.build_graph()
@@ -156,7 +157,10 @@ class MigrationLoader(object):
else:
return list(self.graph.root_nodes(key[0]))[-1]
except IndexError:
- raise ValueError("Dependency on app with no migrations: %s" % key[0])
+ if self.ignore_no_migrations:
+ return None
+ else:
+ raise ValueError("Dependency on app with no migrations: %s" % key[0])
raise ValueError("Dependency on unknown app: %s" % key[0])
def build_graph(self):