Add a redirect to the course enroll page for labs
2 open threads
Make sure to read our contributing guide
Merge request reports
Activity
added 22 commits
-
2a897360...ce787640 - 21 commits from branch
development
- 1ef5e536 - Add a redirect to the course enroll page for labs
-
2a897360...ce787640 - 21 commits from branch
546 546 @ExceptionHandler(AccessDeniedException.class) 547 547 public String notInLab(@AuthenticatedUser User user, HttpServletRequest request, 548 548 Exception e) { 549 Pattern testPattern = Pattern.compile("/lab/([0-9]+)/*"); 549 Pattern testPattern = Pattern.compile("/lab/([0-9]+)[/]?.*"); 550 550 Matcher matcher = testPattern.matcher(request.getRequestURI()); 551 551 552 if (matcher.matches() && matcher.groupCount() == 1) { 552 Course course = labRepository.findById(Long.parseLong(matcher.group(1))).orElseThrow() 553 .getCourse(); 554 return "redirect:/course/" + course.getId() + "/enroll"; 553 Long labId = Long.parseLong(matcher.group(1)); 546 546 @ExceptionHandler(AccessDeniedException.class) 547 547 public String notInLab(@AuthenticatedUser User user, HttpServletRequest request, 548 548 Exception e) { 549 Pattern testPattern = Pattern.compile("/lab/([0-9]+)/*"); 549 Pattern testPattern = Pattern.compile("/lab/([0-9]+)[/]?.*");
Please register or sign in to reply