Skip to content

Commit

Permalink
adjusted endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonEntholzer committed Sep 22, 2024
1 parent 304caa6 commit f9a3472
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ public ResponseEntity<Map<String, String>> updateTestFiles(@PathVariable("auxili
if (versionControlService.isEmpty()) {
throw new ResponseStatusException(HttpStatus.SERVICE_UNAVAILABLE, "VCSNotPresent");
}

ProgrammingExercise exercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationElseThrow(auxiliaryRepositoryId);
AuxiliaryRepository auxiliaryRepository = auxiliaryRepositoryRepository.findByIdElseThrow(auxiliaryRepositoryId);
ProgrammingExercise exercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationElseThrow(auxiliaryRepository.getExercise().getId());

Repository repository;
try {
repositoryAccessService.checkAccessTestOrAuxRepositoryElseThrow(true, exercise, userRepository.getUserWithGroupsAndAuthorities(principal.getName()), "test");
repository = gitService.getOrCheckoutRepository(exercise.getVcsTestRepositoryUri(), true);
repository = gitService.getOrCheckoutRepository(auxiliaryRepository.getVcsRepositoryUri(), true);
}
catch (AccessForbiddenException e) {
FileSubmissionError error = new FileSubmissionError(auxiliaryRepositoryId, "noPermissions");
Expand Down

0 comments on commit f9a3472

Please sign in to comment.