DEV: DiscourseEvents fired when users are added/removed from groups (#9522)
This commit is contained in:
parent
3bbd8b1258
commit
54ec9f7009
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue