Fix default role assigning on projects create through the dashboard [SCI-8728]

This commit is contained in:
Andrej 2023-06-22 16:39:24 +02:00
parent c71d8df470
commit 0ea3a10d26

View file

@ -16,7 +16,10 @@ class CreateProjectService
@params[:created_by] = @user
@params[:last_modified_by] = @user
@project = @team.projects.create!(@params)
@project = @team.projects.build(@params)
@project.default_public_user_role ||= UserRole.find_predefined_viewer_role if @project.visible?
@project.save!
create_project_activity
end
@project