Skip to content

Commit

Permalink
Fix filter ID comparison when attaching filters to a CLM project (bsc…
Browse files Browse the repository at this point in the history
…#1215949) (#22928)
  • Loading branch information
cbbayburt authored Nov 2, 2023
1 parent b7062ad commit f37e296
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public static String updateFiltersOfProject(Request req, Response res, User user

List<Long> filterIdsToDetach = dbContentProject.getProjectFilters()
.stream()
.map(filter -> filter.getFilter().getId())
.map(pf -> pf.getFilter().getId())
.filter(filterId -> !filtersIdToUpdate.contains(filterId))
.collect(Collectors.toList());
filterIdsToDetach.forEach(filterId -> CONTENT_MGR.detachFilter(
Expand All @@ -123,11 +123,9 @@ public static String updateFiltersOfProject(Request req, Response res, User user
List<Long> filterIdsToAttach = filtersIdToUpdate
.stream()
.filter(filterId ->
!dbContentProject.getProjectFilters()
dbContentProject.getProjectFilters()
.stream()
.filter(filter -> filter.getId() == filterId)
.findFirst()
.isPresent()
.noneMatch(pf -> pf.getFilter().getId() == filterId)
)
.collect(Collectors.toList());
filterIdsToAttach
Expand Down
1 change: 1 addition & 0 deletions java/spacewalk-java.changes.cbbayburt.bsc1215949
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix filter ID comparison when attaching filters to a CLM project (bsc#1215949)

0 comments on commit f37e296

Please sign in to comment.