Fixes #1140 Captcha doesn't show up after too many failed login attempts

Fixes #1140 Captcha doesn't show up after too many failed login attempts

Removes one query and updates code.