From fb1c6b1dbfb0030b1529be9b52f7532a6d6b4adb Mon Sep 17 00:00:00 2001 From: ap-Codkelden Date: Sat, 26 Jan 2019 00:27:14 +0200 Subject: [PATCH] more strict regex for two-letter language code --- core/lib/point/core/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/point/core/user.py b/core/lib/point/core/user.py index 609cf45..8220307 100644 --- a/core/lib/point/core/user.py +++ b/core/lib/point/core/user.py @@ -311,7 +311,7 @@ def get_active_account(self, type=None): _profile_table = 'users.profile' _profile = { 'private': {'type': 'bool', 'default': False}, - 'lang': {'type': 'str', 're': re.compile(r'^[a-z]{2}$'), + 'lang': {'type': 'str', 're': re.compile(r'^(?:by|en|ru|uk)$'), 'default':settings.lang}, 'tz': {'type': 'int', 'default': settings.timezone}, 'deny_anonymous': {'type': 'bool', 'default': False}