From 4e8c35ce3409e9007ba82efe68e8ed8b554366ae Mon Sep 17 00:00:00 2001 From: Nick Ninov Date: Fri, 27 Mar 2026 08:46:01 +0200 Subject: [PATCH] bot: display name validation - https://github.com/status-im/status-app/issues/20273 --- bot/account.py | 4 ++-- docs/account.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bot/account.py b/bot/account.py index 2575914..65ee507 100644 --- a/bot/account.py +++ b/bot/account.py @@ -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 diff --git a/docs/account.md b/docs/account.md index 799fd59..0d0526e 100644 --- a/docs/account.md +++ b/docs/account.md @@ -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 (`_`)**