Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: fallback to default on best_match #365

Merged
merged 4 commits into from
Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions microsetta_private_api/localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
LANG_NAME_KEY = "lang_name"
LANG_TAG_KEY = "language_tag"


LANG_SUPPORT = {
EN_US: {
NEW_PARTICIPANT_KEY: american_gut._NEW_PARTICIPANT,
Expand Down
3 changes: 2 additions & 1 deletion microsetta_private_api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ def get_locale():
if not flask.has_request_context():
return EN_US

return request.accept_languages.best_match([EN_US, ES_MX])
return request.accept_languages.best_match([EN_US, ES_MX],
default=EN_US)

init_celery(celery, app.app)

Expand Down