fixed undo after reanalysis

This commit is contained in:
Timo 2021-07-19 11:57:29 +03:00
parent 93844d8e76
commit 0b89c55a1d

View File

@ -666,17 +666,22 @@ public class RedactionLogCreatorService {
// Cannot undo Already Approved change because UI won't allow it for now
if (Status.REQUESTED.equals(entry.getStatus())) {
if (entry.getManualRedactionType() == ManualRedactionType.RECATEGORIZE) {
entry.setManual(false);
entry.setStatus(null);
entry.setRecategorizationType(null);
var recategorizeExists = manualRedactions.getImageRecategorizations().stream().anyMatch(entryToAdd -> entryToAdd.getId().equalsIgnoreCase(entry.getId()));
if (!recategorizeExists) {
if (entry.getManualRedactionType() == ManualRedactionType.RECATEGORIZE) {
entry.setManual(false);
entry.setStatus(null);
entry.setRecategorizationType(null);
}
}
if (entry.getManualRedactionType() == ManualRedactionType.LEGAL_BASIS_CHANGE) {
entry.setManual(false);
entry.setStatus(null);
entry.setLegalBasisChangeValue(null);
var legalBasisChangeExists = manualRedactions.getImageRecategorizations().stream().anyMatch(entryToAdd -> entryToAdd.getId().equalsIgnoreCase(entry.getId()));
if (!legalBasisChangeExists) {
if (entry.getManualRedactionType() == ManualRedactionType.LEGAL_BASIS_CHANGE) {
entry.setManual(false);
entry.setStatus(null);
entry.setLegalBasisChangeValue(null);
}
}
}
}