[1.7.x] Fixed #22848: Ignore no-migrations errors during makemigrations only