summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMarten Kenbeek <marten.knbk@gmail.com>2015-05-24 21:17:39 +0200
committerTim Graham <timograham@gmail.com>2015-05-25 13:47:50 -0400
commitd73176a84273c06fa11075c65293ec28497a8423 (patch)
treef36b5140e21cd5752ee0c4009500c6efa95e8987 /django
parent73b5b0b4a5989f159c6dadcb670ab30b01402382 (diff)
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.
Diffstat (limited to 'django')
-rw-r--r--django/db/migrations/loader.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py
index f1edefca9b..24c1dc1d18 100644
--- a/django/db/migrations/loader.py
+++ b/django/db/migrations/loader.py
@@ -79,9 +79,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: