From d3442b32c659601688a85455c6be20dfcb9eba7e Mon Sep 17 00:00:00 2001 From: Matti Lupari Date: Tue, 9 Jan 2024 14:15:43 +0200 Subject: [PATCH] CSCEXAM-1154 Show examination event enrolments even if event started --- app/repository/EnrolmentRepository.java | 11 +++++++---- project/plugins.sbt | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/repository/EnrolmentRepository.java b/app/repository/EnrolmentRepository.java index f6f5f8b5d..de62b551d 100644 --- a/app/repository/EnrolmentRepository.java +++ b/app/repository/EnrolmentRepository.java @@ -125,10 +125,13 @@ private List doGetStudentEnrolments(User user) { .endJunction() .findList() .stream() - .filter(ee -> - ee.getExaminationEventConfiguration() == null || - ee.getExaminationEventConfiguration().getExaminationEvent().getStart().isAfter((DateTime.now())) - ) + .filter(ee -> { + if (ee.getExaminationEventConfiguration() == null) { + return true; + } + var start = ee.getExaminationEventConfiguration().getExaminationEvent().getStart(); + return start.plusMinutes(ee.getExam().getDuration()).isAfter(now); + }) .toList(); enrolments.forEach(ee -> { Exam exam = ee.getExam(); diff --git a/project/plugins.sbt b/project/plugins.sbt index 6c4dd8ede..909dd8144 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releases/" -addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.0") +addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.1") addSbtPlugin("org.playframework" % "sbt-play-ebean" % "8.0.0")