diff options
| author | Simon Charette <charette.s@gmail.com> | 2016-01-25 14:27:35 -0500 |
|---|---|---|
| committer | Simon Charette <charette.s@gmail.com> | 2016-01-25 22:02:45 -0500 |
| commit | abdbf00815ae8f49247082528d02a3d0890785a9 (patch) | |
| tree | 92f0026826112c16994b008f9a5e14c0ddf9c185 /django | |
| parent | 3306106fb1ce610e0961ce319a98e33c93795c1f (diff) | |
[1.9.x] Fixed #26135 -- Adjusted the migration questioner's handling of disabled apps.
This was causing an issue when calling the `migrate` command in a test case with
the `available_apps` attribute pointing to an application with migrations
disabled using the `MIGRATION_MODULES` setting.
Thanks to Tim Graham for the review.
Refs #24919
Backport of 4dcaa5871b70859952c6f9c437dfe1b5f10509f2 from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/migrations/questioner.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/django/db/migrations/questioner.py b/django/db/migrations/questioner.py index aef80f4a52..47d4cdf130 100644 --- a/django/db/migrations/questioner.py +++ b/django/db/migrations/questioner.py @@ -38,6 +38,9 @@ class MigrationQuestioner(object): except LookupError: # It's a fake app. return self.defaults.get("ask_initial", False) migrations_import_path = MigrationLoader.migrations_module(app_config.label) + if migrations_import_path is None: + # It's an application with migrations disabled. + return self.defaults.get("ask_initial", False) try: migrations_module = importlib.import_module(migrations_import_path) except ImportError: |
