Improve user team invitation logic [SCI-7577]

This commit is contained in:
Oleksii Kriuchykhin 2022-12-13 11:34:56 +01:00
parent ff6471ce14
commit 89258ce2ae
2 changed files with 3 additions and 1 deletions

View file

@ -99,7 +99,7 @@ module Users
result[:status] = :user_exists_and_in_team
else
# Also generate user team relation
team.user_assignments.create(user: user, user_role: @user_role, assigned_by: current_user)
team.user_assignments.create!(user: user, user_role: @user_role, assigned_by: current_user)
generate_notification(
@user,

View file

@ -35,6 +35,8 @@ module UserAssignments
end
@team.team_shared_repositories.find_each do |team_shared_repository|
next if team_shared_repository.shared_object.blank?
@team.repository_sharing_user_assignments.create!(
user: @user,
user_role: @user_role,