mirror of
https://github.com/django/django.git
synced 2025-10-30 00:56:09 +00:00
[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 d73176a842 from master
This commit is contained in:
committed by
Tim Graham
parent
122e688a9c
commit
1ac4c7d415
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user