diff options
| author | Jayden Kneller <jayden@arrai.com> | 2025-11-03 12:05:59 -0500 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2025-11-04 08:15:22 -0500 |
| commit | e27cff68a32a0183c6b8d110b359c1c858f68cd7 (patch) | |
| tree | ab021c78b5cf8069fefc71ee8329efbb2865d384 /django | |
| parent | eaf7b563a5d3861026242fdb503a58f71acf17f6 (diff) | |
Fixed #36652 -- Increased determinism when loading migrations from disk.
Ordering still depends on pkgutil.iter_modules, which does not guarantee
order, but at least now Django is not introducing additional indeterminism,
causing CircularDependencyError to appear or not appear in some edge cases.
Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/migrations/loader.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py index 66944c7ab7..db81f6f78f 100644 --- a/django/db/migrations/loader.py +++ b/django/db/migrations/loader.py @@ -109,11 +109,11 @@ class MigrationLoader: if was_loaded: reload(module) self.migrated_apps.add(app_config.label) - migration_names = { + migration_names = [ name for _, name, is_pkg in pkgutil.iter_modules(module.__path__) if not is_pkg and name[0] not in "_~" - } + ] # Load migrations for migration_name in migration_names: migration_path = "%s.%s" % (module_name, migration_name) |
