diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/StudentTeamEntity.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/StudentTeamEntity.java index 4897e2e..0fa0efd 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/StudentTeamEntity.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/StudentTeamEntity.java @@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import java.io.IOException; +import java.util.List; import java.util.Optional; @Controller @@ -80,9 +81,11 @@ public class StudentTeamEntity { Optional optionalStudentTeam = this.studentTeamRepository.findById(teamId); if (optionalCourse.isPresent() && optionalStudentTeam.isPresent()) { + List eligibleStudents = optionalCourse.get().getStudents(); + eligibleStudents.sort((s1, s2) -> s1.getLastName().compareToIgnoreCase(s2.getLastName())); model.addAttribute("course", optionalCourse.get()); model.addAttribute("student_team", optionalStudentTeam.get()); - model.addAttribute("eligible_students", optionalCourse.get().getStudents()); + model.addAttribute("eligible_students", eligibleStudents); } return "courses/entity/student_teams/entity/add_student"; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/util/github/GithubManager.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/util/github/GithubManager.java index df986b5..11f2de7 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/util/github/GithubManager.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/util/github/GithubManager.java @@ -221,7 +221,7 @@ public class GithubManager { users.add(this.github.getUser(s.getGithubUsername())); } - repository.removeCollaborators(users); + //repository.removeCollaborators(users); GHTeam taTeam = organization.getTeamByName(studentTeam.getAssignedTeachingAssistantTeam().getGithubTeamName()); taTeam.remove(repository);