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/integrations.rb')
-rw-r--r--lib/api/integrations.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/api/integrations.rb b/lib/api/integrations.rb
index a73e34f54a3..0d182ade558 100644
--- a/lib/api/integrations.rb
+++ b/lib/api/integrations.rb
@@ -113,6 +113,14 @@ module API
integration = user_project.find_or_initialize_integration(slug.underscore)
params = declared_params(include_missing: false).merge(active: true)
+ if integration.is_a?(::Integrations::GitlabSlackApplication)
+ if integration.new_record?
+ render_api_error!('You cannot create the GitLab for Slack app from the API', 422)
+ end
+
+ params.delete(:active)
+ end
+
if integration.update(params)
present integration, with: Entities::ProjectIntegration
else