diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-04-23 11:25:08 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-04-23 11:25:08 +0100 |
commit | 192df7d931e002163459541be820cebb46a1aebf (patch) | |
tree | f18358e0093e258f8a19d7b5931520a4195cc4fa /lib/api/projects.rb | |
parent | 4e2b96d6af561a09dc3623c893e7e2ca212100f6 (diff) | |
parent | eb1cb7bed6951bdda54abd55e86fd793e6954a56 (diff) | |
download | gitlab-ce-192df7d931e002163459541be820cebb46a1aebf.tar.gz |
Merge branch 'master' into fl-prettify-2
* master: (74 commits)
Add changelog for 2fa filter in users api
Add 2FA filter to users API for admins only
Fix project creation for user endpoint bug
Flowdock uses Gitaly, not Grit
Add missing changelog type to docs
Removes 'no job log' from trace action
Fix missing namespace for some internal users
Dedupe yarn dependencies
Downgrade MySQL CI service from 8.0 to 5.7
Atomic internal ids for all models
Add documentation on how to configure Redis Sentinel by persistent class
Update CHANGELOG.md for 10.7.0
Update index.md
Resolve "Text from the diff is showing within a table header inside the discussion after the discussion is resolved"
Ignore ordering in IssueDueSchedulerWorker spec
Don't include lfs_file_locks data in export bundle
Documentation: Frontend Building Checklist
Fix a documentation typo for GitLab pages
Refactored activity calendar
Add an API endpoint to download git repository snapshots
...
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 51b3b0459f3..8871792060b 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -74,6 +74,11 @@ module API present options[:with].prepare_relation(projects, options), options end + + def translate_params_for_compatibility(params) + params[:builds_enabled] = params.delete(:jobs_enabled) if params.key?(:jobs_enabled) + params + end end resource :users, requirements: API::PROJECT_ENDPOINT_REQUIREMENTS do @@ -123,7 +128,7 @@ module API end post do attrs = declared_params(include_missing: false) - attrs[:builds_enabled] = attrs.delete(:jobs_enabled) if attrs.key?(:jobs_enabled) + attrs = translate_params_for_compatibility(attrs) project = ::Projects::CreateService.new(current_user, attrs).execute if project.saved? @@ -155,6 +160,7 @@ module API not_found!('User') unless user attrs = declared_params(include_missing: false) + attrs = translate_params_for_compatibility(attrs) project = ::Projects::CreateService.new(user, attrs).execute if project.saved? @@ -276,7 +282,7 @@ module API authorize! :rename_project, user_project if attrs[:name].present? authorize! :change_visibility_level, user_project if attrs[:visibility].present? - attrs[:builds_enabled] = attrs.delete(:jobs_enabled) if attrs.key?(:jobs_enabled) + attrs = translate_params_for_compatibility(attrs) result = ::Projects::UpdateService.new(user_project, current_user, attrs).execute |