[1.7.x] Fixed #22862 -- Added --noinput option to makemigrations.

Thanks artortenburger for the report.

Backport of fbb684d95e from master