Skip to content

Commit

Permalink
catalog: Allow update internal fields even if clinical analysis is lo…
Browse files Browse the repository at this point in the history
…cked #1880
  • Loading branch information
j-coll committed Jan 21, 2022
1 parent 5952095 commit 9ea2ca2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,11 @@ OpenCGAResult<Object> privateUpdate(ClientSession clientSession, Family family,
if (queryOptions.getBoolean(Constants.INCREMENT_VERSION)) {
createNewVersion(clientSession, family.getStudyUid(), family.getUid());
} else {
checkInUseInLockedClinicalAnalysis(clientSession, family);
boolean internalUpdateOnly = parameters.keySet().stream().allMatch(key -> key.startsWith("internal."));
// Don't need to check if locked when updating only internal fields
if (!internalUpdateOnly) {
checkInUseInLockedClinicalAnalysis(clientSession, family);
}
}

DataResult result = updateAnnotationSets(clientSession, family.getUid(), parameters, variableSetList, queryOptions, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,11 @@ OpenCGAResult<Object> privateUpdate(ClientSession clientSession, Individual indi
if (queryOptions.getBoolean(Constants.INCREMENT_VERSION)) {
createNewVersion(clientSession, individual.getStudyUid(), individual.getUid());
} else {
checkInUseInLockedClinicalAnalysis(clientSession, individual);
boolean internalUpdateOnly = parameters.keySet().stream().allMatch(key -> key.startsWith("internal."));
// Don't need to check if locked when updating only internal fields
if (!internalUpdateOnly) {
checkInUseInLockedClinicalAnalysis(clientSession, individual);
}
}

DataResult result = updateAnnotationSets(clientSession, individual.getUid(), parameters, variableSetList, queryOptions, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,11 @@ OpenCGAResult<Object> privateUpdate(ClientSession clientSession, Document sample
if (queryOptions.getBoolean(Constants.INCREMENT_VERSION)) {
createNewVersion(clientSession, studyUid, sampleUid);
} else {
checkInUseInLockedClinicalAnalysis(clientSession, sampleDocument);
boolean internalUpdateOnly = parameters.keySet().stream().allMatch(key -> key.startsWith("internal."));
// Don't need to check if locked when updating only internal fields
if (!internalUpdateOnly) {
checkInUseInLockedClinicalAnalysis(clientSession, sampleDocument);
}
}

// Perform the update
Expand Down

0 comments on commit 9ea2ca2

Please sign in to comment.