DEV: DiscourseEvents fired when users are added/removed from groups (#9522)

This commit is contained in:
Mark VanLandingham 2020-04-22 23:53:31 -05:00 committed by GitHub
parent 3bbd8b1258
commit 54ec9f7009
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,7 @@ class GroupActionLogger
def log_add_user_to_group(target_user)
(target_user == @acting_user && @group.public_admission) || can_edit?
DiscourseEvent.trigger(:user_added_to_group, target_user, @group)
GroupHistory.create!(default_params.merge(
action: GroupHistory.actions[:add_user_to_group],
target_user: target_user
@ -37,6 +38,7 @@ class GroupActionLogger
def log_remove_user_from_group(target_user)
(target_user == @acting_user && @group.public_exit) || can_edit?
DiscourseEvent.trigger(:user_removed_from_group, target_user, @group)
GroupHistory.create!(default_params.merge(
action: GroupHistory.actions[:remove_user_from_group],
target_user: target_user