summaryrefslogtreecommitdiff
path: root/lib/api/pipeline_schedules.rb
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-05-17 21:26:18 +0900
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-05-30 23:55:09 +0900
commitdf6040bbd41a639b3d0aa339b2dc0e84d67b811b (patch)
treece38cc4c45b360436ec3fa4d850ef46281415e2c /lib/api/pipeline_schedules.rb
parentc7fc65e0672a3c88e15f033be3b4d4258bc36e2f (diff)
downloadgitlab-ce-df6040bbd41a639b3d0aa339b2dc0e84d67b811b.tar.gz
zj keen eye2
Diffstat (limited to 'lib/api/pipeline_schedules.rb')
-rw-r--r--lib/api/pipeline_schedules.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/api/pipeline_schedules.rb b/lib/api/pipeline_schedules.rb
index 9429306fe20..58888417888 100644
--- a/lib/api/pipeline_schedules.rb
+++ b/lib/api/pipeline_schedules.rb
@@ -54,7 +54,7 @@ module API
.new(user_project, current_user, declared_params(include_missing: false))
.execute
- if pipeline_schedule.valid?
+ if pipeline_schedule.persisted?
present pipeline_schedule, with: Entities::PipelineSchedule
else
render_validation_error!(pipeline_schedule)
@@ -98,7 +98,6 @@ module API
return not_found!('PipelineSchedule') unless pipeline_schedule
if pipeline_schedule.own!(current_user)
- status :ok
present pipeline_schedule, with: Entities::PipelineSchedule
else
render_validation_error!(pipeline_schedule)