Refactor locale validation and update style consistency across schemas, tests, and migrations

- Replaced `SUPPORTED_LOCALES` with `supported_locales` for naming consistency.
- Applied formatting improvements to multiline statements for better readability.
- Cleaned up redundant comments and streamlined test assertions.
This commit is contained in:
Felipe Cardoso
2025-11-17 20:04:03 +01:00
parent 68e04a911a
commit b7c1191335
5 changed files with 16 additions and 24 deletions

View File

@@ -117,8 +117,9 @@ async def get_locale(
if current_user and current_user.locale:
# Validate that saved locale is still supported
# (in case SUPPORTED_LOCALES changed after user set preference)
if current_user.locale in SUPPORTED_LOCALES:
return current_user.locale
locale_value = str(current_user.locale)
if locale_value in SUPPORTED_LOCALES:
return locale_value
# Priority 2: Accept-Language header
accept_language = request.headers.get("accept-language", "")