diff --git a/network-api/networkapi/wagtailpages/customblocks.py b/network-api/networkapi/wagtailpages/customblocks.py index 33ba3a6b9b..b375b60d00 100644 --- a/network-api/networkapi/wagtailpages/customblocks.py +++ b/network-api/networkapi/wagtailpages/customblocks.py @@ -1,5 +1,3 @@ -import re - from wagtail.core import blocks from wagtail.images.blocks import ImageChooserBlock @@ -252,15 +250,6 @@ class Meta: class PulseProjectQueryValue(blocks.StructValue): - @property - def query(self): - # Replace any combination of spaces and commas with a single + - # because despite instructions to use spaces, someone, at some - # point, will accidentally use a comma, and that should be fine. - search_terms = self['search_terms'].strip() - query = re.sub(r'[\s,]+', '+', search_terms) - return query - @property def size(self): max_number_of_results = self['max_number_of_results'] diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/blocks/pulse_project_list.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/blocks/pulse_project_list.html index f40aa24fa5..e5bad04795 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/blocks/pulse_project_list.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/blocks/pulse_project_list.html @@ -4,5 +4,5 @@ data-help="{{ value.help }}" data-issues="{{ value.issues }}" data-max="{{ value.size }}" - data-query="{{ value.query }}" - data-reversed="{{ value.newest_first }}" /> + data-query="{{ value.search_terms }}" + data-reversed="{{ value.newest_first }}"> diff --git a/network-api/networkapi/wagtailpages/utils.py b/network-api/networkapi/wagtailpages/utils.py index 47b8a8ab35..694a42d8d9 100644 --- a/network-api/networkapi/wagtailpages/utils.py +++ b/network-api/networkapi/wagtailpages/utils.py @@ -44,10 +44,10 @@ def get_descendants(node, list, authenticated=False, depth=0, max_depth=2): nextset = node.get_children().in_menu() - # Do not show draft pages to users who are + # Do not show draft/private pages to users who are # not logged into the CMS itself. if authenticated is False: - nextset = nextset.live() + nextset = nextset.live().public() for child in nextset: get_descendants(child, list, authenticated, depth + 1)