summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-10-06 20:55:01 +0000
committerStan Hu <stanhu@gmail.com>2018-10-06 20:55:01 +0000
commitc3389c8006443e2b4d994eb15e60bd249fc4732f (patch)
treecd9907005e22cee90cd646d0d994783c93fceb4c /app
parent2fce6d6f9b28bb8136c23ec89c0efe143694dbc4 (diff)
parentf934b2160384a177d01f66b606d57961a1c8a3cb (diff)
downloadgitlab-ce-c3389c8006443e2b4d994eb15e60bd249fc4732f.tar.gz
Check disabled_services when finding a service See merge request gitlab-org/gitlab-ce!22172
Diffstat (limited to 'app')
-rw-r--r--app/models/project.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 3fa47c1cda3..0cdd876dc20 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1088,9 +1088,7 @@ class Project < ActiveRecord::Base
find_or_initialize_service(service_name)
end
- available_services.reject do |service|
- disabled_services.include?(service.to_param)
- end
+ available_services.compact
end
def disabled_services
@@ -1098,6 +1096,8 @@ class Project < ActiveRecord::Base
end
def find_or_initialize_service(name)
+ return if disabled_services.include?(name)
+
service = find_service(services, name)
return service if service