diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-23 15:09:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-23 15:09:30 +0300 |
commit | f46d20e5088ca9c58793e3b6044facfa74feb7ed (patch) | |
tree | 5affa9b7fb8837a0cef99f0efa4229f019fe38fc /lib/api/helpers.rb | |
parent | 17f2e5035c716bccb6bd7073215e9b2d449184e7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index fc1037131d8..c73a5482cac 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -476,9 +476,9 @@ module API render_api_error!('202 Accepted', 202) end - def render_validation_error!(model) + def render_validation_error!(model, status = 400) if model.errors.any? - render_api_error!(model_error_messages(model) || '400 Bad Request', 400) + render_api_error!(model_error_messages(model) || '400 Bad Request', status) end end |