Don't emit migrations signals if there's no migration plan.
Review Request #14746 — Created Dec. 23, 2025 and updated
An updated signal handler for the pre/post migrations signals inside
Django was assuming that theplanargument was not None, and was
crashing when we would emit those signals.This change moves those signal emissions inside the nearby conditionals
so we only emit them if we're actually doing anything with migrations.This also sets a default value for
full_migration_planso that static
checkers don't warn about it possibly being unbound.
Ran unit tests without causing a crash deep inside Django.
| Summary | ID |
|---|---|
| muvptuyptkulyuuokussrrwumxpkwyrl |
| Description | From | Last Updated |
|---|---|---|
|
I think this is correct now that we're dropping syncdb-supporting Django versions, but it wouldn't have been for those. It … |
|
-
-
I think this is correct now that we're dropping syncdb-supporting Django versions, but it wouldn't have been for those. It might be worth adding a note in the comments calling these stating that these used to be called unconditionally but are now only called if we now we're migrating and therefore have a plan. I think otherwise the rationale for this change can get lost over time as code is moved around, and it might be notable.
- Commits:
-
Summary ID muvptuyptkulyuuokussrrwumxpkwyrl muvptuyptkulyuuokussrrwumxpkwyrl - Diff:
-
Revision 2 (+54 -32)