[1.7.x] Fixed #22951 -- Checked for types during deep_deconstruct migration serializ

Thanks Sam Hartsfield for the report.

Backport of 4680d25df2 from master
[1.7.x] Fixed #23307 -- Clarified the way max_num limits the output of formsets.

Thanks velle for the report.

Backport of 5f3806b861 from master
[1.7.x] Fixed #23431 -- Allowed inline and hidden references to admin fields.

This fixes a regression introduced by the 53ff096982 security fix.

Thanks to @a1tus for the report and Tim for the review.

refs #23329.

Backport of 342ccbddc1 from master
[1.7.x] Fixed #23418 -- Fail when migration deconstruct produces invalid import

Backport of d28b5f13b3 from master
[1.7.x] Fixed broken test from da160d440f; refs #23418.

Backport of 16548cfc7c from master
[1.7.x] Fixed #23451 -- Fixed typo in inlineformset_factory() error message.

Backport of f7eee04ebe from master
[1.7.x] Fixed flake8 warning.

Backport of 5cba975d26 from master