mirror of
https://github.com/status-im/status-python-sdk.git
synced 2026-08-30 21:51:14 +00:00
bot: display name validation
- https://github.com/status-im/status-app/issues/20273
This commit is contained in:
+2
-2
@@ -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
|
||||
|
||||
@@ -9,6 +9,7 @@ The **display name** is the human‑readable 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 (`A–Z`)**
|
||||
- It may contain **spaces (` `)**
|
||||
- It may contain **numbers (`0–9`)**
|
||||
- It may contain **hyphens (`-`)**
|
||||
- It may contain **underscores (`_`)**
|
||||
|
||||
Reference in New Issue
Block a user