Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/registrations_controller.rb')
-rw-r--r--app/controllers/registrations_controller.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index 04cb9616cf6..e7872eeac27 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -6,8 +6,6 @@ class RegistrationsController < Devise::RegistrationsController
include RecaptchaHelper
include InvisibleCaptchaOnSignup
- BLOCKED_PENDING_APPROVAL_STATE = 'blocked_pending_approval'.freeze
-
layout 'devise'
prepend_before_action :check_captcha, only: :create
@@ -167,12 +165,18 @@ class RegistrationsController < Devise::RegistrationsController
end
def set_user_state
- return unless Gitlab::CurrentSettings.require_admin_approval_after_user_signup
+ return unless set_blocked_pending_approval?
+
+ resource.state = User::BLOCKED_PENDING_APPROVAL_STATE
+ end
- resource.state = BLOCKED_PENDING_APPROVAL_STATE
+ def set_blocked_pending_approval?
+ Gitlab::CurrentSettings.require_admin_approval_after_user_signup
end
def set_invite_params
@invite_email = ActionController::Base.helpers.sanitize(params[:invite_email])
end
end
+
+RegistrationsController.prepend_if_ee('EE::RegistrationsController')