summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-07 15:09:30 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-07 15:09:30 +0000
commitc6b3ec3f56fa32a0e0ed3de0d0878d25f1adaddf (patch)
tree967afee9a510ff9dd503ebd83706dc760ec2e3ed /app/controllers
parent903ccf7c93eb9490c76857bffe744249cc07de09 (diff)
downloadgitlab-ce-c6b3ec3f56fa32a0e0ed3de0d0878d25f1adaddf.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/alerting/notifications_controller.rb8
-rw-r--r--app/controllers/projects/prometheus/alerts_controller.rb7
2 files changed, 3 insertions, 12 deletions
diff --git a/app/controllers/projects/alerting/notifications_controller.rb b/app/controllers/projects/alerting/notifications_controller.rb
index 1fe31863469..358e7629958 100644
--- a/app/controllers/projects/alerting/notifications_controller.rb
+++ b/app/controllers/projects/alerting/notifications_controller.rb
@@ -14,7 +14,7 @@ module Projects
token = extract_alert_manager_token(request)
result = notify_service.execute(token)
- head(response_status(result))
+ head result.http_status
end
private
@@ -33,12 +33,6 @@ module Projects
.new(project, current_user, notification_payload)
end
- def response_status(result)
- return :ok if result.success?
-
- result.http_status
- end
-
def notification_payload
params.permit![:notification]
end
diff --git a/app/controllers/projects/prometheus/alerts_controller.rb b/app/controllers/projects/prometheus/alerts_controller.rb
index 8c74c730de9..2c0521edece 100644
--- a/app/controllers/projects/prometheus/alerts_controller.rb
+++ b/app/controllers/projects/prometheus/alerts_controller.rb
@@ -26,12 +26,9 @@ module Projects
def notify
token = extract_alert_manager_token(request)
+ result = notify_service.execute(token)
- if notify_service.execute(token)
- head :ok
- else
- head :unprocessable_entity
- end
+ head result.http_status
end
def create