diff options
| author | Marten Kenbeek <marten.knbk@gmail.com> | 2015-05-24 21:17:39 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-05-25 13:56:37 -0400 |
| commit | 1ac4c7d415750ddc648cbf888bc2fbcde933f799 (patch) | |
| tree | 2fc32e367b57db1fe3773f246d436e1053afc8f3 /django | |
| parent | 122e688a9c2fa71f47f13f134ab18cf5ea668e7a (diff) | |
[1.8.x] Fixed #24848 -- Fixed ValueError for faulty migrations module.
Added apps to unmigrated apps if the migrations module is a file
or a folder missing __init__.py.
Thanks to Ernest0x for the bug report.
Backport of d73176a84273c06fa11075c65293ec28497a8423 from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/migrations/loader.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py index add2907ca8..fccf7d3205 100644 --- a/django/db/migrations/loader.py +++ b/django/db/migrations/loader.py @@ -77,9 +77,11 @@ class MigrationLoader(object): else: # PY3 will happily import empty dirs as namespaces. if not hasattr(module, '__file__'): + self.unmigrated_apps.add(app_config.label) continue # Module is not a package (e.g. migrations.py). if not hasattr(module, '__path__'): + self.unmigrated_apps.add(app_config.label) continue # Force a reload if it's already loaded (tests need this) if was_loaded: |
