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
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-06-07 15:09:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-07 15:09:00 +0300
commitba27dbddc7dbc42f2cc8d84e815a9ea19f87a81d (patch)
treee71fba864897fa78be7f0c40ded23d0f719abf84 /lib
parent708815aefead73a61473c1a611aea169ab16a358 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/api/users.rb8
-rw-r--r--lib/gitlab/database/background_migration/batched_migration.rb4
-rw-r--r--lib/gitlab/gon_helper.rb1
3 files changed, 10 insertions, 3 deletions
diff --git a/lib/api/users.rb b/lib/api/users.rb
index 40453ed2384..ff36a4cfe95 100644
--- a/lib/api/users.rb
+++ b/lib/api/users.rb
@@ -710,9 +710,13 @@ module API
user = User.find_by(id: params[:id])
not_found!('User') unless user
- forbidden!('A blocked user must be unblocked to be activated') if user.blocked?
- user.activate
+ result = ::Users::ActivateService.new(current_user).execute(user)
+ if result[:status] == :success
+ true
+ else
+ render_api_error!(result[:message], result[:reason] || :bad_request)
+ end
end
desc 'Approve a pending user. Available only for admins.'
diff --git a/lib/gitlab/database/background_migration/batched_migration.rb b/lib/gitlab/database/background_migration/batched_migration.rb
index 2118393beb0..83beee091f1 100644
--- a/lib/gitlab/database/background_migration/batched_migration.rb
+++ b/lib/gitlab/database/background_migration/batched_migration.rb
@@ -79,6 +79,10 @@ module Gitlab
transition any => :finalizing
end
+ before_transition any => :finished do |migration|
+ migration.finished_at = Time.current if migration.respond_to?(:finished_at)
+ end
+
before_transition any => :active do |migration|
migration.started_at = Time.current if migration.respond_to?(:started_at)
end
diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb
index bf46c28af9d..ca9a2a2db60 100644
--- a/lib/gitlab/gon_helper.rb
+++ b/lib/gitlab/gon_helper.rb
@@ -68,7 +68,6 @@ module Gitlab
push_frontend_feature_flag(:security_auto_fix)
push_frontend_feature_flag(:source_editor_toolbar)
push_frontend_feature_flag(:vscode_web_ide, current_user)
- push_frontend_feature_flag(:super_sidebar_peek, current_user)
push_frontend_feature_flag(:unbatch_graphql_queries, current_user)
push_frontend_feature_flag(:command_palette, current_user)
# To be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/399248