Skip to content

Commit 11d343d

Browse files
Merge pull request #546 from biocore/csymons_restrict_japanese
Restrict Japanese to Residents of Japan
2 parents 6e9791a + c7a9ff8 commit 11d343d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

microsetta_private_api/api/_account.py

+5
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ def check_email_match(account_id, token_info):
124124
def update_account(account_id, body, token_info):
125125
acc = _validate_account_access(token_info, account_id)
126126

127+
# Prevent users outside Japan from selecting Japanese
128+
if body['language'] == "ja_JP" and\
129+
body['address']['country_code'] != "JP":
130+
return jsonify(code=422, message="Invalid language selected"), 422
131+
127132
with Transaction() as t:
128133
acct_repo = AccountRepo(t)
129134
acc.first_name = body['first_name']

0 commit comments

Comments
 (0)