mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-02-01 21:44:55 -05:00
Merge pull request #499 from matrix-org/invalid_user_name
Add specific error code for invalid user names.
This commit is contained in:
commit
5bf1a3d6dc
@ -42,6 +42,7 @@ class Codes(object):
|
||||
EXCLUSIVE = "M_EXCLUSIVE"
|
||||
THREEPID_AUTH_FAILED = "M_THREEPID_AUTH_FAILED"
|
||||
THREEPID_IN_USE = "THREEPID_IN_USE"
|
||||
INVALID_USER_NAME = "M_INVALID_USER_NAME"
|
||||
|
||||
|
||||
class CodeMessageException(RuntimeError):
|
||||
|
@ -53,7 +53,8 @@ class RegistrationHandler(BaseHandler):
|
||||
raise SynapseError(
|
||||
400,
|
||||
"User ID must only contain characters which do not"
|
||||
" require URL encoding."
|
||||
" require URL encoding.",
|
||||
Codes.INVALID_USER_NAME
|
||||
)
|
||||
|
||||
user = UserID(localpart, self.hs.hostname)
|
||||
|
Loading…
x
Reference in New Issue
Block a user