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

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

This reverts commit 54ec9f700988a5b7dd0bf2894bee48d780ecf082.

The commit clashes with a previous implementation of the same event

diff --git a/app/services/group_action_logger.rb b/app/services/group_action_logger.rb
index 4f38fd5..01620a7 100644
--- a/app/services/group_action_logger.rb
+++ b/app/services/group_action_logger.rb
@@ -28,7 +28,6 @@ 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
@@ -38,7 +37,6 @@ 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

GitHub sha: d69ec186

@SamSaffron oops. Yeah grepping for those, I see them now. The specs were failing for a reason :speak_no_evil:

1 Like