2401 Only write examiners comment if it's new

This commit is contained in:
Andreas Svanberg 2021-11-08 11:08:34 +01:00
parent 99a002a628
commit d359056cc6

@ -57,12 +57,13 @@ public class RejectedThesisWorker extends AbstractWorker {
final FinalThesis finalThesis = finalThesisService.findByProject(project);
if (finalThesis != null && finalThesis.getStatus() != FinalThesis.Status.REJECTED && finalThesis.getLastModified().before(rejectedDate)) {
finalThesisService.reject(project);
if (thesisRejection.isVisibleToAuthors()) {
projectForumService.createThread(project, null,
"Thesis rejected by examiner",
"This is an automated message generated by the system.\n\nThe following comment was provided by the examiner. Consult with your supervisor what actions to take from here.\n\n" + thesisRejection.getMessage(),
Collections.emptySet());
}
}
// Check dates here since the API call is only date-based rather than time as well.
if (thesisRejection.isVisibleToAuthors() && rejectedDate.after(getLastSuccessfulRun())) {
projectForumService.createThread(project, null,
"Thesis rejected by examiner",
"This is an automated message generated by the system.\n\nThe following comment was provided by the examiner. Consult with your supervisor what actions to take from here.\n\n" + thesisRejection.getMessage(),
Collections.emptySet());
}
}
}