Don't emit migrations signals if there's no migration plan.
Review Request #14746 — Created Dec. 23, 2025 and updated — Latest diff uploaded
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.