Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 46f8ef1

Browse files
committed
Improve the error code when trying to register using a name reserved for guests.
1 parent 731dfff commit 46f8ef1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

changelog.d/8135.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Clarify the error code if a user tries to register with a numeric ID. This bug was introduced in v1.15.0.

synapse/handlers/register.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ async def check_username(
124124
try:
125125
int(localpart)
126126
raise SynapseError(
127-
400, "Numeric user IDs are reserved for guest users."
127+
400,
128+
"Numeric user IDs are reserved for guest users.",
129+
errcode=Codes.INVALID_USERNAME,
128130
)
129131
except ValueError:
130132
pass

0 commit comments

Comments
 (0)