diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-01-19 16:37:06 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-01-19 16:37:06 +0000 |
commit | c8d66514efcf946f847cb3120b271d8f0f0327f2 (patch) | |
tree | 92d6c3a2041c8095cea58295b41ed12b8d24669d | |
parent | dec341ca39b25554fa8b6602e848081b968a3049 (diff) | |
parent | 2ece1b774aac36f4a92801c665355e7fe1c4d48f (diff) | |
download | gitlab-ce-c8d66514efcf946f847cb3120b271d8f0f0327f2.tar.gz |
Merge branch 'fix-project-creation' into 'master'
Creator should be added as a master of the project on creation
Fixes: #4222
See merge request !2463
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/services/projects/create_service.rb | 2 | ||||
-rw-r--r-- | spec/services/projects/create_service_spec.rb | 1 |
3 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG index 207ddf1dd64..adda5373c3c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -67,6 +67,7 @@ v 8.4.0 (unreleased) - Improve UX in builds artifacts browser - Increase default size of `data` column in `events` table when using MySQL - Expose button to CI Lint tool on project builds page + - Fix: Creator should be added as a master of the project on creation v 8.3.4 - Use gitlab-workhorse 0.5.4 (fixes API routing bug) diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb index a6820183bee..c94d7ab710f 100644 --- a/app/services/projects/create_service.rb +++ b/app/services/projects/create_service.rb @@ -95,7 +95,7 @@ module Projects system_hook_service.execute_hooks_for(@project, :create) unless @project.group - @project.team << [current_user, :master, current_user] + @project.team << [current_user, :master] end @project.import_start if @project.import? diff --git a/spec/services/projects/create_service_spec.rb b/spec/services/projects/create_service_spec.rb index 5d0b18558b1..e43903dbd3c 100644 --- a/spec/services/projects/create_service_spec.rb +++ b/spec/services/projects/create_service_spec.rb @@ -32,6 +32,7 @@ describe Projects::CreateService, services: true do it { expect(@project).to be_valid } it { expect(@project.owner).to eq(@user) } + it { expect(@project.team.masters).to include(@user) } it { expect(@project.namespace).to eq(@user.namespace) } end |