apply: define LANGUAGE setting (fixes 500 on first handled ApplicationResult)
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) <noreply@anthropic.com>
This commit is contained in:
parent
85d73328c5
commit
9fbe1ce728
1 changed files with 4 additions and 0 deletions
|
|
@ -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 ---")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue