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

Commit

Permalink
Improve the error code when trying to register using a name reserved …
Browse files Browse the repository at this point in the history
…for guests. (#8135)
  • Loading branch information
clokep authored Aug 20, 2020
1 parent dbc630a commit 592cdf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/8135.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarify the error code if a user tries to register with a numeric ID. This bug was introduced in v1.15.0.
4 changes: 3 additions & 1 deletion synapse/handlers/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ async def check_username(
try:
int(localpart)
raise SynapseError(
400, "Numeric user IDs are reserved for guest users."
400,
"Numeric user IDs are reserved for guest users.",
errcode=Codes.INVALID_USERNAME,
)
except ValueError:
pass
Expand Down

0 comments on commit 592cdf7

Please sign in to comment.