diff options
Diffstat (limited to 'app/services/groups/destroy_service.rb')
-rw-r--r-- | app/services/groups/destroy_service.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/services/groups/destroy_service.rb b/app/services/groups/destroy_service.rb index 497fdb09cdc..f565612a89d 100644 --- a/app/services/groups/destroy_service.rb +++ b/app/services/groups/destroy_service.rb @@ -1,8 +1,7 @@ module Groups class DestroyService < Groups::BaseService def async_execute - # Soft delete via paranoia gem - group.destroy + group.soft_delete_without_removing_associations job_id = GroupDestroyWorker.perform_async(group.id, current_user.id) Rails.logger.info("User #{current_user.id} scheduled a deletion of group ID #{group.id} with job ID #{job_id}") end @@ -10,7 +9,7 @@ module Groups def execute group.prepare_for_destroy - group.projects.with_deleted.each do |project| + group.projects.each do |project| # Execute the destruction of the models immediately to ensure atomic cleanup. # Skip repository removal because we remove directory with namespace # that contain all these repositories @@ -22,6 +21,8 @@ module Groups DestroyService.new(group, current_user).execute end + group.chat_team&.remove_mattermost_team(current_user) + group.really_destroy! end end |