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)

(cherry picked from commit f37e296)
  • Loading branch information
cbbayburt committed Dec 1, 2023
1 parent 57f7a85 commit 84e0d28
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().equals(filterId))
.findFirst()
.isPresent()
.noneMatch(pf -> pf.getFilter().getId().equals(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 84e0d28

Please sign in to comment.