From aae3be1891e635a8d87ab58814f0b625dbee4d77 Mon Sep 17 00:00:00 2001 From: Vivek Agrawal Date: Thu, 29 Sep 2022 01:51:33 +0530 Subject: [PATCH] Do not output deleted channel nodes on search --- contentcuration/search/viewsets/contentnode.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contentcuration/search/viewsets/contentnode.py b/contentcuration/search/viewsets/contentnode.py index 58660fce5b..676698031d 100644 --- a/contentcuration/search/viewsets/contentnode.py +++ b/contentcuration/search/viewsets/contentnode.py @@ -52,11 +52,11 @@ def filter_channel_list(self, queryset, name, value): if value == "public": channel_ids = Channel.get_public_channels().values_list("id", flat=True) elif value == "edit" and user: - channel_ids = user.editable_channels.values_list("id", flat=True) + channel_ids = user.editable_channels.filter(deleted=False).values_list("id", flat=True) elif value == "bookmark" and user: - channel_ids = user.bookmarked_channels.values_list("id", flat=True) + channel_ids = user.bookmarked_channels.filter(deleted=False).values_list("id", flat=True) elif value == "view" and user: - channel_ids = user.view_only_channels.values_list("id", flat=True) + channel_ids = user.view_only_channels.filter(deleted=False).values_list("id", flat=True) return queryset.filter(channel_id__in=list(channel_ids))