From 02db980d10f6fcaa796b762acc1cbfbc973c8bdf Mon Sep 17 00:00:00 2001 From: Steve Jalim Date: Tue, 19 Nov 2024 15:40:04 +0000 Subject: [PATCH] Lower threshold for determining whether there is 'enough' VPN Content to justify an index page Back when the entire VPN RC was powered by Contentful, we added logic that would only allow the index page of the VPN RC to be displayed in a particular locale if there were 'enough' articles translated into that locale. 'Enough' was defined not as a specific threshold but as a percentage of the overall number of documents available in en-US. Initially, this was fine, but as the number of documents in en-US grew the threshold failed to be reached, meaning the index pages for non-en-US locales would redirect to en-US instead, because they didn't have "enough". This bad decision will become irrelevant as soon as we start publishing localized versions of the VPN content via the CMS, and then deleting the code for the non-CMS page versions. However, we need a fix now, so that if someone selects a locale from the footer of the en-US VPN RC index page, they don't get redirected back to that same page. The simplest fix is just to drop the threshold to 10%, down from 60%. This basicallly makes that content redundant, but still supports the idea of hiding the index if there are just one or two articles there (there are 25 in en-US, so 10% would be hit if there are 3 or more available in the other locale -- and _all_ of the other locales seem to have at least 5 articles localized to them, so this is fine as a threshold.) Resolves #15521 --- bedrock/settings/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bedrock/settings/base.py b/bedrock/settings/base.py index 37864934f47..971115f5b35 100644 --- a/bedrock/settings/base.py +++ b/bedrock/settings/base.py @@ -1049,7 +1049,7 @@ def _is_bedrock_custom_app(app_name): CONTENTFUL_LOCALE_SUFFICIENT_CONTENT_PERCENTAGE = config( "CONTENTFUL_LOCALE_SUFFICIENT_CONTENT_PERCENTAGE", - default="1" if DEV is True else "60", + default="1" if DEV is True else "10", parser=float, )