Skip to content
Snippets Groups Projects
Unverified Commit c9b16729 authored by Ahmad Farhat's avatar Ahmad Farhat Committed by GitHub
Browse files

Make room delete permanent (#2390)

parent b2500e65
Branches
Tags
No related merge requests found
...@@ -137,7 +137,10 @@ class RoomsController < ApplicationController ...@@ -137,7 +137,10 @@ class RoomsController < ApplicationController
begin begin
# Don't delete the users home room. # Don't delete the users home room.
raise I18n.t("room.delete.home_room") if @room == @room.owner.main_room raise I18n.t("room.delete.home_room") if @room == @room.owner.main_room
@room.destroy
# Destroy all recordings then permanently delete the room
delete_all_recordings(@room.bbb_id)
@room.destroy(true)
rescue => e rescue => e
flash[:alert] = I18n.t("room.delete.fail", error: e) flash[:alert] = I18n.t("room.delete.fail", error: e)
else else
......
...@@ -155,6 +155,8 @@ class UsersController < ApplicationController ...@@ -155,6 +155,8 @@ class UsersController < ApplicationController
# Permanently delete the rooms under the user if they have not been reassigned # Permanently delete the rooms under the user if they have not been reassigned
if perm_delete if perm_delete
@user.rooms.include_deleted.each do |room| @user.rooms.include_deleted.each do |room|
# Destroy all recordings then permanently delete the room
delete_all_recordings(room.bbb_id)
room.destroy(true) room.destroy(true)
end end
end end
......
...@@ -550,6 +550,7 @@ describe UsersController, type: :controller do ...@@ -550,6 +550,7 @@ describe UsersController, type: :controller do
it "allows admins to permanently delete users" do it "allows admins to permanently delete users" do
allow(Rails.configuration).to receive(:loadbalanced_configuration).and_return(true) allow(Rails.configuration).to receive(:loadbalanced_configuration).and_return(true)
allow_any_instance_of(User).to receive(:greenlight_account?).and_return(true) allow_any_instance_of(User).to receive(:greenlight_account?).and_return(true)
allow_any_instance_of(BbbServer).to receive(:delete_all_recordings).and_return("")
allow_any_instance_of(ApplicationController).to receive(:set_user_domain).and_return("provider1") allow_any_instance_of(ApplicationController).to receive(:set_user_domain).and_return("provider1")
controller.instance_variable_set(:@user_domain, "provider1") controller.instance_variable_set(:@user_domain, "provider1")
...@@ -568,6 +569,7 @@ describe UsersController, type: :controller do ...@@ -568,6 +569,7 @@ describe UsersController, type: :controller do
it "permanently deletes the users rooms if the user is permanently deleted" do it "permanently deletes the users rooms if the user is permanently deleted" do
allow(Rails.configuration).to receive(:loadbalanced_configuration).and_return(true) allow(Rails.configuration).to receive(:loadbalanced_configuration).and_return(true)
allow_any_instance_of(User).to receive(:greenlight_account?).and_return(true) allow_any_instance_of(User).to receive(:greenlight_account?).and_return(true)
allow_any_instance_of(BbbServer).to receive(:delete_all_recordings).and_return("")
allow_any_instance_of(ApplicationController).to receive(:set_user_domain).and_return("provider1") allow_any_instance_of(ApplicationController).to receive(:set_user_domain).and_return("provider1")
controller.instance_variable_set(:@user_domain, "provider1") controller.instance_variable_set(:@user_domain, "provider1")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment