Skip to content
Snippets Groups Projects

Redirect to request when there is a processing request

3 files
+ 78
8
Compare changes
  • Side-by-side
  • Inline

Files

@@ -142,10 +142,16 @@ public class LabController {
.collect(Collectors.toList()));
// Check whether there is an open request for the authenticated user and add it to the model
qSession.getOpenRequestForPerson(person.getId()).ifPresent(r -> {
model.addAttribute("current", r.toViewDTO());
model.addAttribute("currentDto", new ModelMapper().map(r, RequestPatchDTO.class));
});
Optional<?> currOptRequest = qSession.getOpenRequestForPerson(person.getId());
if (currOptRequest.isPresent()) {
Request<?> currRequest = (Request<?>) currOptRequest.get();
// If the user is currently being processed it should be looking at the request page
if (currRequest.getEventInfo().getStatus().isProcessing()) {
return "redirect:/request/" + currRequest.getId();
}
model.addAttribute("current", currRequest.toViewDTO());
model.addAttribute("currentDto", new ModelMapper().map(currRequest, RequestPatchDTO.class));
}
// Check whether there is a finished selection request for the authenticated user and add it
if (qSession instanceof CapacitySession) {
Loading