Update of sharing options to all teams is not saved [SCI-7421] (#4852)

* Update of sharing options to all teams is not saved
This commit is contained in:
G-Chubinidze 2023-01-20 17:14:34 +04:00 committed by GitHub
parent 599ef71c90
commit 913cd26e70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -259,11 +259,10 @@ class Repository < RepositoryBase
Team.where.not(id: team.id).find_each do |team|
team.users.find_each do |user|
team.repository_sharing_user_assignments.create!(
team.repository_sharing_user_assignments.find_or_initialize_by(
user: user,
user_role: shared_write? ? normal_user_role : viewer_role,
assignable: self
)
).update!(user_role: shared_write? ? normal_user_role : viewer_role)
end
end
end