RED-8707 - Don't remove resize redactions which are not dictionary based when removing dictionary entry

This commit is contained in:
Andrei Isvoran 2024-03-11 16:32:04 +02:00
parent 7a9d90a76c
commit 43e85af0e9

View File

@ -300,7 +300,8 @@ public class ManualRedactionDictionaryUpdateHandler {
resizeRedactionsWithSameValue.forEach(resizeRedaction -> {
var file = fileStatusPersistenceService.getStatus(resizeRedaction.getId().getFileId());
var dossierForResizeRedaction = dossierPersistenceService.findByDossierId(file.getDossierId());
if (!file.getWorkflowStatus().equals(WorkflowStatus.APPROVED) && dossierTemplateId.equals(dossierForResizeRedaction.getDossierTemplateId())) {
if (!file.getWorkflowStatus().equals(WorkflowStatus.APPROVED) && dossierTemplateId.equals(dossierForResizeRedaction.getDossierTemplateId())
&& (resizeRedaction.isAddToAllDossiers() || resizeRedaction.getUpdateDictionary())) {
resizeRedactionPersistenceService.hardDelete(resizeRedaction.getId().getFileId(), resizeRedaction.getId().getAnnotationId());
}
});