FIX: Skip validation on enforcing second factor change if the value is "no"

Without this, this site setting breaks plugin tests if local logins are
disabled in the plugin.
This commit is contained in:
Jeff Wong 2019-12-06 16:42:15 -08:00
parent da66950cf5
commit e7bd288d7b

View File

@ -151,6 +151,7 @@ module SiteSettings::Validations
def validate_enforce_second_factor(new_val) def validate_enforce_second_factor(new_val)
return if SiteSetting.enable_local_logins return if SiteSetting.enable_local_logins
return if new_val == "no"
validate_error :second_factor_cannot_be_enforced_with_disabled_local_login validate_error :second_factor_cannot_be_enforced_with_disabled_local_login
end end