Closed TheoChevalier closed 3 months ago
Another theory, Kiswahili is the only locale where the translation of "Blog" is a different word (it’s "Blogu"), could it be the code is looking up for the blog index using the translated title, thus not finding it?
This seem to be the right theory, updating the title translation on https://foundation.mozilla.org/sw/blog/ fixes the issue.
I think this needs to be updated: https://github.com/MozillaFoundation/foundation.mozilla.org/blob/main/network-api/networkapi/wagtailpages/pagemodels/blog/blog.py#L277-L279
We could probably do this using Q
from django.db.models import Q
blog_page = BlogIndexPage.objects.get(Q(title__iexact="Blog") | Q(title__iexact="Blogu"), locale=default_locale)
It doesn't fix the underlining issue and if another index is created with "Bloga" it would throw the same exception. We should also wrap it in a try / except
to avoid crashing the page
@TheoChevalier fyi- a fix for this is on staging, and will be live next deployment
➤ Simon Acosta Torres commented:
Rob DiVincenzo Whenever you have some time, could we revisit this ticket and see if we should still tackle and how easy this would be considering Kevin latest comment?
Opening the Kiswahili page of the blog section from the Common Voice microsite https://foundation.mozilla.org/sw/common-voice/blog/ crashes with
networkapi.wagtailpages.pagemodels.blog.blog_index.BlogIndexPage.DoesNotExist: BlogIndexPage matching query does not exist.
Note: only the Kiswahili version crashes, all other locales work fine. I don’t see anything wrong in the translations, so I’m not sure what could be the cause. Maybe something from a translated blog post loaded in the page?
Another theory, Kiswahili is the only locale where the translation of "Blog" is a different word (it’s "Blogu"), could it be the code is looking up for the blog index using the translated title, thus not finding it?
Full crash log:
┆Issue is synchronized with this Jira Bug