Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public ProgramBreedingMethodEntity updateBreedingMethod(ProgramBreedingMethodEnt
@Override
public void enableSystemMethods(List<UUID> systemBreedingMethods, UUID programId, UUID userId) throws ApiException, BadRequestException {
List<ProgramBreedingMethodEntity> inUseMethods = fetchBreedingMethodsInUse(programId);
if(!systemBreedingMethods.containsAll(inUseMethods.stream().map(method -> method.getId()).collect(Collectors.toList()))) {
if(!systemBreedingMethods.containsAll(inUseMethods.stream().filter(method -> method.getProgramId() == null).map(method -> method.getId()).collect(Collectors.toList()))) {
throw new BadRequestException("Breeding method is not allowed to be edited");
}

Expand Down