Skip to content
This repository was archived by the owner on Jun 29, 2019. It is now read-only.

Commit ac160f4

Browse files
authored
Merge pull request #148 from FAForever/fix/147-invalid-usernames
URGENT Fix/147 invalid usernames
2 parents 3ea1a4e + 4df48fa commit ac160f4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

api/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from api.error import ApiException, Error, ErrorCode
1515
from config import CRYPTO_KEY
1616

17-
USERNAME_REGEX = re.compile("[A-Za-z]{1}[A-Za-z0-9_-]{2,15}")
17+
USERNAME_REGEX = re.compile("[A-Za-z]{1}[A-Za-z0-9_-]{2,15}$")
1818
EMAIL_REGEX = re.compile(r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$")
1919

2020

tests/unit_tests/test_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_validate_username_success(setup_users):
5252

5353
def test_validate_username_illegal_syntax(setup_users):
5454
with pytest.raises(ApiException) as excInfo:
55-
validate_username("x,y")
55+
validate_username("xxx yyy")
5656

5757
assert excInfo.value.errors[0].code == ErrorCode.INVALID_USERNAME
5858

0 commit comments

Comments
 (0)