Fixed #21270 -- Fixed E701 pep8 warnings
Merge pull request #1762 from alasdairnicol/ticket_21270

Fixed #21270 -- Fixed E701 pep8 warnings
Removed some dead code and simplified some other ocde
Fixed #21280 -- Don't generate empty migration files
Remove some unnecesary uses of bool