summaryrefslogtreecommitdiff
path: root/app/models/application_setting.rb
diff options
context:
space:
mode:
authorGabriel Mazetto <gabriel@gitlab.com>2015-12-28 18:21:34 -0200
committerGabriel Mazetto <gabriel@gitlab.com>2015-12-28 18:50:29 -0200
commita3469d914aaf28a1184247cbe72e5197ce7ca006 (patch)
tree8bc68cf4adf391142bcfa8bf2cc7a3d7a572ead2 /app/models/application_setting.rb
parentaf00558d38806eda2fa70c8fdc34be98fced44a4 (diff)
downloadgitlab-ce-a3469d914aaf28a1184247cbe72e5197ce7ca006.tar.gz
reCAPTCHA is configurable through Admin Settings, no reload needed.
Diffstat (limited to 'app/models/application_setting.rb')
-rw-r--r--app/models/application_setting.rb28
1 files changed, 18 insertions, 10 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index 7c107da116c..be69d317d73 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -44,24 +44,32 @@ class ApplicationSetting < ActiveRecord::Base
attr_accessor :restricted_signup_domains_raw
validates :session_expire_delay,
- presence: true,
- numericality: { only_integer: true, greater_than_or_equal_to: 0 }
+ presence: true,
+ numericality: { only_integer: true, greater_than_or_equal_to: 0 }
validates :home_page_url,
- allow_blank: true,
- url: true,
- if: :home_page_url_column_exist
+ allow_blank: true,
+ url: true,
+ if: :home_page_url_column_exist
validates :after_sign_out_path,
- allow_blank: true,
- url: true
+ allow_blank: true,
+ url: true
validates :admin_notification_email,
- allow_blank: true,
- email: true
+ allow_blank: true,
+ email: true
validates :two_factor_grace_period,
- numericality: { greater_than_or_equal_to: 0 }
+ numericality: { greater_than_or_equal_to: 0 }
+
+ validates :recaptcha_site_key,
+ presence: true,
+ if: :recaptcha_enabled
+
+ validates :recaptcha_private_key,
+ presence: true,
+ if: :recaptcha_enabled
validates_each :restricted_visibility_levels do |record, attr, value|
unless value.nil?