[1.7.x] Fixed flake8 error.

Backport of a96dbda6d3 from master
[1.7.x] Added database migration for contrib.auth.

refs #22170.

Backport of b341f33697 from master