bot: display name validation

- https://github.com/status-im/status-app/issues/20273
This commit is contained in:
Nick Ninov
2026-03-27 08:46:01 +02:00
parent 0933807f0d
commit 4e8c35ce34
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -686,7 +686,7 @@ class Account:
if len(name) > 24:
raise ValueError("Display name cannot be more than 24 characters long.")
if not re.fullmatch(r"[A-Za-z0-9_-]+", name):
raise ValueError("Display name can contain only A-Z, 0-9, hyphens (-), and underscores (_).")
if not re.fullmatch(r"[A-Za-z0-9 _-]+", name):
raise ValueError("Display name can contain only A-Z, 0-9, hyphens (-), underscores (_) and spaces.")
return True
+1
View File
@@ -9,6 +9,7 @@ The **display name** is the humanreadable identifier for a Status account. It
Display names must follow strict validation rules enforced by the library and expected by the Status application. A valid display name must satisfy all of the following conditions:
- It may contain **uppercase letters (`AZ`)**
- It may contain **spaces (` `)**
- It may contain **numbers (`09`)**
- It may contain **hyphens (`-`)**
- It may contain **underscores (`_`)**