summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-04-27 13:13:09 +0000
committerRémy Coutable <remy@rymai.me>2017-04-27 13:13:09 +0000
commit39ff809980efa3f4b1ddbd66f2ae2c843a6f0e9e (patch)
tree8f7aa6b961fbea1340a5fe2f14277d7ac3a05cd8 /app
parent19a3b49f47ef68eec12663945fa9e2163179853d (diff)
parent69f584edb4738d4de82f0301bb2ac8f6b3998814 (diff)
downloadgitlab-ce-39ff809980efa3f4b1ddbd66f2ae2c843a6f0e9e.tar.gz
Merge branch 'tc-make-user-master-project-by-admin' into 'master'
Make namespace owner master of project upon creation Closes #29446 See merge request !10910
Diffstat (limited to 'app')
-rw-r--r--app/services/projects/create_service.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb
index 7828c5806b0..535d93385e6 100644
--- a/app/services/projects/create_service.rb
+++ b/app/services/projects/create_service.rb
@@ -97,7 +97,8 @@ module Projects
system_hook_service.execute_hooks_for(@project, :create)
unless @project.group || @project.gitlab_project_import?
- @project.team << [current_user, :master, current_user]
+ owners = [current_user, @project.namespace.owner].compact.uniq
+ @project.add_master(owners, current_user: current_user)
end
@project.group&.refresh_members_authorized_projects