2934 Set correct examination date
This commit is contained in:
parent
8821c94d49
commit
1dd5997870
@ -48,6 +48,7 @@ import se.su.dsv.scipro.util.Either;
|
||||
import javax.inject.Inject;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@ -243,7 +244,7 @@ public class RoughDraftApprovalDecisionPage extends ReviewerPage {
|
||||
author.getIdentifier(),
|
||||
examination.id(),
|
||||
passingGrade.letter(),
|
||||
LocalDate.now());
|
||||
getExaminationDate());
|
||||
if (!reported.isRight()) {
|
||||
if (reported.left() == ReportGradeError.NO_GRADING_ROLE) {
|
||||
RoughDraftApprovalDecisionPage.this.error(getString("failed_to_report_phase_two_grade"));
|
||||
@ -266,6 +267,15 @@ public class RoughDraftApprovalDecisionPage extends ReviewerPage {
|
||||
}
|
||||
}
|
||||
|
||||
private LocalDate getExaminationDate() {
|
||||
return approval.getObject()
|
||||
.getCurrentDecision()
|
||||
.getRequested()
|
||||
.toInstant()
|
||||
.atZone(ZoneId.of("Europe/Stockholm"))
|
||||
.toLocalDate();
|
||||
}
|
||||
|
||||
private Grade getPassingGrade(Examination examination) {
|
||||
Optional<Grade> passingGrade = examination.grades()
|
||||
.stream()
|
||||
|
Loading…
x
Reference in New Issue
Block a user