Be more resilient in the case of missing omniauth settings
Should no longer freak out when omniauth settings aren't present in gitlab.yml. People who aren't using it shouldn't even have to put a 'false' entry in their config for it (and probably wouldn't, after an upgrade).
This commit is contained in:
parent
3643df1f7c
commit
0d77209ea0
3 changed files with 10 additions and 8 deletions
|
@ -121,19 +121,19 @@ class Settings < Settingslogic
|
|||
end
|
||||
|
||||
def ldap_enabled?
|
||||
ldap['enabled']
|
||||
rescue
|
||||
ldap && ldap['enabled']
|
||||
rescue Settingslogic::MissingSetting
|
||||
false
|
||||
end
|
||||
|
||||
def omniauth_enabled?
|
||||
omniauth && omniauth['enabled']
|
||||
rescue
|
||||
rescue Settingslogic::MissingSetting
|
||||
false
|
||||
end
|
||||
|
||||
def omniauth_providers
|
||||
omniauth['providers'] || []
|
||||
(omniauth_enabled? && omniauth['providers']) || []
|
||||
end
|
||||
|
||||
def disable_gravatar?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue