From 9fbe1ce7285336660501721cc9a98d83431adc50 Mon Sep 17 00:00:00 2001 From: EiSiMo Date: Tue, 21 Apr 2026 17:45:42 +0200 Subject: [PATCH] apply: define LANGUAGE setting (fixes 500 on first handled ApplicationResult) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit apply/language.py references LANGUAGE via \`from settings import *\`, but the constant was never added to apply/settings.py. Python only errored at the first runtime use — which is \`str(ApplicationResult)\` in the /apply handler. Any outcome that didn't short-circuit before the final \`return ApplyResponse(message=str(result), …)\` blew up with NameError → 500. Add LANGUAGE = getenv("LANGUAGE", "de") so existing translations.toml keys resolve. Reproduced live inside the apply container: NameError: name 'LANGUAGE' is not defined at language.py:15. Co-Authored-By: Claude Opus 4.7 (1M context) --- apply/settings.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apply/settings.py b/apply/settings.py index 4bd13ff..f7615f4 100644 --- a/apply/settings.py +++ b/apply/settings.py @@ -46,6 +46,10 @@ POST_SUBMISSION_SLEEP_MS: int = get_int_env("POST_SUBMISSION_SLEEP_MS", "0") # --- Service ----------------------------------------------------------------- INTERNAL_API_KEY: str = get_env_or_fail("INTERNAL_API_KEY") +# --- Translations ------------------------------------------------------------ +# Key into translations.toml (e.g. "de", "en"). Used by language.get_text. +LANGUAGE: str = getenv("LANGUAGE", "de") + def log_settings() -> None: logger.debug("--- Settings ---")