From 907a62df286eb013eb6475b1c47f285a7e5750e1 Mon Sep 17 00:00:00 2001 From: Matrix Date: Thu, 3 May 2018 23:54:20 +0000 Subject: [PATCH] fix strip_invalid_mxid_characters --- synapse/rest/client/v2_alpha/register.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py index b5704a39d9..36676c9fa8 100644 --- a/synapse/rest/client/v2_alpha/register.py +++ b/synapse/rest/client/v2_alpha/register.py @@ -387,7 +387,7 @@ class RegisterRestServlet(RestServlet): self.hs.config.register_mxid_from_3pid == 'email' and LoginType.EMAIL_IDENTITY in auth_result ): - address = auth_result[login_type]['address'] + address = auth_result[LoginType.EMAIL_IDENTITY]['address'] desired_username = types.strip_invalid_mxid_characters( address.replace('@', '-').lower() ) @@ -427,7 +427,7 @@ class RegisterRestServlet(RestServlet): self.hs.config.register_mxid_from_3pid == 'msisdn' and LoginType.MSISDN in auth_result ): - desired_username = auth_result[login_type]['address'] + desired_username = auth_result[LoginType.MSISDN]['address'] else: raise SynapseError( 400, "Cannot derive mxid from 3pid; no recognised 3pid"