integreat-cms
integreat-cms copied to clipboard
Hidden languages are listed in fallback translation text
Describe the Bug
The fallback text for missing page translations also lists existing public translations in languages which are disabled/hidden.
Steps to Reproduce
- Create a page which has no translation in e.g. "ar" but a public translation in "fa"
- Mark "fa" as "not visible in app"
- Request API for language "ar"
- See fallback text which lists the option for "fa"
Expected Behavior
Hidden and disabled languages should not be listed in the fallback translations
Actual Behavior
They are listed if the translations itself are public
Additional Information
Maybe this also has implications in other places of the cms - e.g. available languages in the API or in the sitemap. Maybe we should exclude these languages in the prefetch_public_translations()
queryset method?