Fix 500 error on login page if ldap enabled and sign-in disabled

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Merge branch 'fix-500-login-disabled' into 'master'

Fix 500 error on login page if ldap enabled and sign-in disabled

Related to gitlab/gitlabhq#1701

See merge request !1209