From fadeaabe38df9b863ba50ced8f53674a8729916b Mon Sep 17 00:00:00 2001 From: Daniil Palagin Date: Thu, 24 Oct 2024 16:49:20 +0200 Subject: [PATCH] [#205] Update preUpdate method --- .../service/repository/RepositoryPatientRecordService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/cz/cvut/kbss/study/service/repository/RepositoryPatientRecordService.java b/src/main/java/cz/cvut/kbss/study/service/repository/RepositoryPatientRecordService.java index 896c5c4..bb30ada 100644 --- a/src/main/java/cz/cvut/kbss/study/service/repository/RepositoryPatientRecordService.java +++ b/src/main/java/cz/cvut/kbss/study/service/repository/RepositoryPatientRecordService.java @@ -73,6 +73,9 @@ protected void prePersist(PatientRecord instance) { @Override protected void preUpdate(PatientRecord instance) { + if(instance.getPhase() != RecordPhase.rejected) { + instance.setRejectMessage(null); + } instance.setLastModifiedBy(securityUtils.getCurrentUser()); instance.setLastModified(new Date()); recordDao.requireUniqueNonEmptyLocalName(instance);