Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion network-api/networkapi/wagtailpages/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
from wagtail.admin.rich_text.converters.html_to_contentstate import InlineStyleElementHandler
from wagtail.core import hooks
from wagtail.core.utils import find_available_slug

from networkapi.wagtailpages.pagemodels.products import BuyersGuidePage, ProductPage
from networkapi.wagtailpages.utils import get_locale_from_request

# The real code runs "instance.sync_trees()" here, but we want this to do nothing instead,
# so that locale creation creates the locale entry but does not try to sync 1300+ pages as
Expand Down Expand Up @@ -142,9 +144,10 @@ def manage_index_pages_cache(request, page):
proper "related posts" in the CMS for blog pages and campaigns.
"""
parent = page.get_parent().specific
locale = get_locale_from_request(request)

if hasattr(parent, 'clear_index_page_cache'):
parent.clear_index_page_cache()
parent.clear_index_page_cache(locale)


@hooks.register("insert_global_admin_js", order=100)
Expand Down