Skip to content

Commit

Permalink
Do not output deleted channel nodes on search
Browse files Browse the repository at this point in the history
  • Loading branch information
vkWeb committed Sep 28, 2022
1 parent 9ec60cf commit aae3be1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contentcuration/search/viewsets/contentnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit aae3be1

Please sign in to comment.