From eb9bd2d9491e550fa2abcd70efa22e56c282f9e1 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 1 May 2015 15:04:20 +0100 Subject: [PATCH] user_id now in user_threepids --- synapse/rest/client/v2_alpha/account.py | 6 +++--- synapse/storage/registration.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/synapse/rest/client/v2_alpha/account.py b/synapse/rest/client/v2_alpha/account.py index 3e522ad39..b082140f1 100644 --- a/synapse/rest/client/v2_alpha/account.py +++ b/synapse/rest/client/v2_alpha/account.py @@ -65,12 +65,12 @@ class PasswordRestServlet(RestServlet): if 'medium' not in threepid or 'address' not in threepid: raise SynapseError(500, "Malformed threepid") # if using email, we must know about the email they're authing with! - threepid_user = yield self.hs.get_datastore().get_user_by_threepid( + threepid_user_id = yield self.hs.get_datastore().get_user_id_by_threepid( threepid['medium'], threepid['address'] ) - if not threepid_user: + if not threepid_user_id: raise SynapseError(404, "Email address not found", Codes.NOT_FOUND) - user_id = threepid_user + user_id = threepid_user_id else: logger.error("Auth succeeded but no known type!", result.keys()) raise SynapseError(500, "", Codes.UNKNOWN) diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py index 530bbe6b4..90e2606be 100644 --- a/synapse/storage/registration.py +++ b/synapse/storage/registration.py @@ -202,15 +202,15 @@ class RegistrationStore(SQLBaseStore): defer.returnValue(ret) @defer.inlineCallbacks - def get_user_by_threepid(self, medium, address): + def get_user_id_by_threepid(self, medium, address): ret = yield self._simple_select_one( "user_threepids", { "medium": medium, "address": address }, - ['user'], True, 'get_user_by_threepid' + ['user_id'], True, 'get_user_id_by_threepid' ) if ret: - defer.returnValue(ret['user']) + defer.returnValue(ret['user_id']) defer.returnValue(None)