DEV: Trigger 'user_added_to_group' when accepting invite with groups ()

This commit is contained in:
Mark VanLandingham 2020-04-27 15:13:34 -05:00 committed by GitHub
parent e92a54f681
commit 051e6be7b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -124,6 +124,7 @@ InviteRedeemer = Struct.new(:invite, :username, :name, :password, :user_custom_f
new_group_ids = invite.groups.pluck(:id) - invited_user.group_users.pluck(:group_id)
new_group_ids.each do |id|
invited_user.group_users.create(group_id: id)
DiscourseEvent.trigger(:user_added_to_group, invited_user, Group.find_by(id: id), automatic: false)
end
end