From 78a907d804daf176d582f4c5208f694b700f4026 Mon Sep 17 00:00:00 2001 From: Ameya Vaichalkar <57044378+ameyagv@users.noreply.github.com> Date: Wed, 2 Aug 2023 18:12:17 -0400 Subject: [PATCH] Empty teams bug fix --- app/controllers/student_teams_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/student_teams_controller.rb b/app/controllers/student_teams_controller.rb index ab53c5b3a6e..ac6e5688f79 100644 --- a/app/controllers/student_teams_controller.rb +++ b/app/controllers/student_teams_controller.rb @@ -112,7 +112,7 @@ def remove_participant # if your old team does not have any members, delete the entry for the team if TeamsUser.where(team_id: params[:team_id]).empty? old_team = AssignmentTeam.find params[:team_id] - if old_team && !old_team.received_any_peer_review? + if (old_team && Team.size(params[:team_id]) == 0 && !old_team.received_any_peer_review?) old_team.destroy # if assignment has signup sheet then the topic selected by the team has to go back to the pool # or to the first team in the waitlist