RED-7599 - Always trigger reanalysis when removing manual redaction #118

Merged
andrei.isvoran.ext merged 1 commits from RED-7599 into master 2023-09-13 15:43:54 +02:00

View File

@ -109,7 +109,6 @@ public class ManualRedactionService {
public List<ManualAddResponse> addRemoveRedaction(String dossierId, String fileId, List<RemoveRedactionRequest> removeRedactionRequests) {
var response = new ArrayList<ManualAddResponse>();
var requiresReAnalysis = false;
var manualRedactions = manualRedactionProviderService.getManualRedactions(fileId);
//validate removing from dossier template dictionary
@ -123,7 +122,6 @@ public class ManualRedactionService {
if (manualAddRedactionsContains(manualRedactions, removeRedactionRequest.getAnnotationId())) {
log.info("hard delete ManualRedactions for file {} and annotation {}", fileId, removeRedactionRequest.getAnnotationId());
manualRedactionProviderService.hardDeleteManualRedactions(fileId, removeRedactionRequest.getAnnotationId());
requiresReAnalysis = true;
continue;
}
@ -144,14 +142,10 @@ public class ManualRedactionService {
removedFromDictionary,
typeIdsOfModifiedDictionaries);
requiresReAnalysis = requiresReAnalysis || removedFromDictionary;
response.add(ManualAddResponse.builder().annotationId(removeRedactionRequest.getAnnotationId()).commentId(commentId).build());
}
if (requiresReAnalysis) {
reprocess(dossierId, fileId);
}
reprocess(dossierId, fileId);
analysisFlagsCalculationService.calculateFlags(dossierId, fileId);