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