diff options
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/register.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py index a6178e74a1..55a03e53ea 100644 --- a/synapse/handlers/register.py +++ b/synapse/handlers/register.py @@ -128,6 +128,15 @@ class RegistrationHandler(BaseHandler): errcode=Codes.FORBIDDEN, ) + if guest_access_token is None: + try: + int(localpart) + raise SynapseError( + 400, "Numeric user IDs are reserved for guest users." + ) + except ValueError: + pass + @defer.inlineCallbacks def register_user( self, @@ -170,15 +179,6 @@ class RegistrationHandler(BaseHandler): was_guest = guest_access_token is not None - if not was_guest: - try: - int(localpart) - raise SynapseError( - 400, "Numeric user IDs are reserved for guest users." - ) - except ValueError: - pass - user = UserID(localpart, self.hs.hostname) user_id = user.to_string() |