Loading django/db/migrations/loader.py +6 −2 Original line number Diff line number Diff line Loading @@ -9,6 +9,9 @@ from django.utils import six from django.conf import settings MIGRATIONS_MODULE_NAME = 'migrations' class MigrationLoader(object): """ Loads migration files from disk, and their status from the database. Loading Loading @@ -46,7 +49,8 @@ class MigrationLoader(object): if app_label in settings.MIGRATION_MODULES: return settings.MIGRATION_MODULES[app_label] else: return '%s.migrations' % apps.get_app_config(app_label).name app_package_name = apps.get_app_config(app_label).name return '%s.%s' % (app_package_name, MIGRATIONS_MODULE_NAME) def load_disk(self): """ Loading @@ -64,7 +68,7 @@ class MigrationLoader(object): except ImportError as e: # I hate doing this, but I don't want to squash other import errors. # Might be better to try a directory check directly. if "No module named" in str(e) and "migrations" in str(e): if "No module named" in str(e) and MIGRATIONS_MODULE_NAME in str(e): self.unmigrated_apps.add(app_config.label) continue raise Loading django/db/migrations/questioner.py +3 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,8 @@ from django.apps import apps from django.utils import datetime_safe from django.utils.six.moves import input from .loader import MIGRATIONS_MODULE_NAME class MigrationQuestioner(object): """ Loading @@ -31,7 +33,7 @@ class MigrationQuestioner(object): app_config = apps.get_app_config(app_label) except LookupError: # It's a fake app. return self.defaults.get("ask_initial", False) migrations_import_path = "%s.migrations" % app_config.name migrations_import_path = "%s.%s" % (app_config.name, MIGRATIONS_MODULE_NAME) try: migrations_module = importlib.import_module(migrations_import_path) except ImportError: Loading Loading
django/db/migrations/loader.py +6 −2 Original line number Diff line number Diff line Loading @@ -9,6 +9,9 @@ from django.utils import six from django.conf import settings MIGRATIONS_MODULE_NAME = 'migrations' class MigrationLoader(object): """ Loads migration files from disk, and their status from the database. Loading Loading @@ -46,7 +49,8 @@ class MigrationLoader(object): if app_label in settings.MIGRATION_MODULES: return settings.MIGRATION_MODULES[app_label] else: return '%s.migrations' % apps.get_app_config(app_label).name app_package_name = apps.get_app_config(app_label).name return '%s.%s' % (app_package_name, MIGRATIONS_MODULE_NAME) def load_disk(self): """ Loading @@ -64,7 +68,7 @@ class MigrationLoader(object): except ImportError as e: # I hate doing this, but I don't want to squash other import errors. # Might be better to try a directory check directly. if "No module named" in str(e) and "migrations" in str(e): if "No module named" in str(e) and MIGRATIONS_MODULE_NAME in str(e): self.unmigrated_apps.add(app_config.label) continue raise Loading
django/db/migrations/questioner.py +3 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,8 @@ from django.apps import apps from django.utils import datetime_safe from django.utils.six.moves import input from .loader import MIGRATIONS_MODULE_NAME class MigrationQuestioner(object): """ Loading @@ -31,7 +33,7 @@ class MigrationQuestioner(object): app_config = apps.get_app_config(app_label) except LookupError: # It's a fake app. return self.defaults.get("ask_initial", False) migrations_import_path = "%s.migrations" % app_config.name migrations_import_path = "%s.%s" % (app_config.name, MIGRATIONS_MODULE_NAME) try: migrations_module = importlib.import_module(migrations_import_path) except ImportError: Loading