From 2e287f3a7ff311032c629b86226c3f3d9373aa0e Mon Sep 17 00:00:00 2001 From: catborise Date: Fri, 6 Nov 2026 11:01:44 +0300 Subject: [PATCH] fix(settings): translations load from any working directory LOCALE_PATHS was the relative "locale/": a manage.py or cron run outside the checkout found no catalogs and fell back to English. It is now under BASE_DIR. Reading data/secret_key also catches only OSError instead of any exception. --- webvirtcloud/settings.py.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webvirtcloud/settings.py.template b/webvirtcloud/settings.py.template index fb413924..5cbb9c68 100644 --- a/webvirtcloud/settings.py.template +++ b/webvirtcloud/settings.py.template @@ -23,7 +23,7 @@ if not SECRET_KEY: if secret_file.exists(): try: SECRET_KEY = secret_file.read_text().strip() - except Exception: + except OSError: pass DEBUG = False @@ -242,7 +242,7 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' LOCALE_PATHS = [ - "locale/", + BASE_DIR / "locale", ] # Resolve the application log path and make sure its directory exists, so a