diff options
author | Erik Johnston <erik@matrix.org> | 2021-04-23 15:46:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-23 15:46:29 +0100 |
commit | a15c003e5b0bff8bf78a675f3b719d3f25fe8bde (patch) | |
tree | 70b5d0d2e6745d84ad2b2d62963eaf49e65b1404 /synapse/rest | |
parent | Remove room and user invite ratelimits in default unit test config (#9871) (diff) | |
download | synapse-a15c003e5b0bff8bf78a675f3b719d3f25fe8bde.tar.xz |
Make DomainSpecificString an attrs class (#9875)
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/synapse/client/new_user_consent.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/synapse/rest/synapse/client/new_user_consent.py b/synapse/rest/synapse/client/new_user_consent.py index e5634f9679..488b97b32e 100644 --- a/synapse/rest/synapse/client/new_user_consent.py +++ b/synapse/rest/synapse/client/new_user_consent.py @@ -61,6 +61,15 @@ class NewUserConsentResource(DirectServeHtmlResource): self._sso_handler.render_error(request, "bad_session", e.msg, code=e.code) return + # It should be impossible to get here without having first been through + # the pick-a-username step, which ensures chosen_localpart gets set. + if not session.chosen_localpart: + logger.warning("Session has no user name selected") + self._sso_handler.render_error( + request, "no_user", "No user name has been selected.", code=400 + ) + return + user_id = UserID(session.chosen_localpart, self._server_name) user_profile = { "display_name": session.display_name, |