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 'lib/api/users.rb')
-rw-r--r--lib/api/users.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/users.rb b/lib/api/users.rb
index ff0b1e87b03..b8c60f1969c 100644
--- a/lib/api/users.rb
+++ b/lib/api/users.rb
@@ -446,12 +446,13 @@ module API
end
# rubocop: disable CodeReuse/ActiveRecord
delete ":id" do
- Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-foss/issues/42279')
+ Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab/issues/20757')
authenticated_as_admin!
user = User.find_by(id: params[:id])
not_found!('User') unless user
+ conflict!('User cannot be removed while is the sole-owner of a group') unless user.can_be_removed? || params[:hard_delete]
destroy_conditionally!(user) do
user.delete_async(deleted_by: current_user, params: params)