Sort list of eligible students, and some other bullshit.

This commit is contained in:
Andrew Lalis 2019-05-10 00:49:38 +02:00 committed by andrewlalis
parent 64f75ea21d
commit 6653047263
2 changed files with 5 additions and 2 deletions

View File

@ -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<StudentTeam> optionalStudentTeam = this.studentTeamRepository.findById(teamId);
if (optionalCourse.isPresent() && optionalStudentTeam.isPresent()) {
List<Student> 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";

View File

@ -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);