summary refs log tree commit diff
path: root/synapse/storage/registration.py
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-10-24 17:18:08 +0100
committerNeil Johnson <neil@matrix.org>2018-10-24 17:18:08 +0100
commitea69a84bbb2fc9c1da6db0384a98f577f3bc95a7 (patch)
treec6b5d38fb5fc9f427ba0ae355258c4fdf55edfb0 /synapse/storage/registration.py
parentcommit transaction before closing (diff)
downloadsynapse-ea69a84bbb2fc9c1da6db0384a98f577f3bc95a7.tar.xz
fix style inconsistencies
Diffstat (limited to 'synapse/storage/registration.py')
-rw-r--r--synapse/storage/registration.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py

index 0f970850e8..80d76bf9d7 100644 --- a/synapse/storage/registration.py +++ b/synapse/storage/registration.py
@@ -474,6 +474,15 @@ class RegistrationStore(RegistrationWorkerStore, @defer.inlineCallbacks def get_user_id_by_threepid(self, medium, address): + """Returns user id from threepid + + Args: + medium (str): threepid medium e.g. email + address (str): threepid address e.g. me@example.com + + Returns: + Deferred[str|None]: user id or None if no user id/threepid mapping exists + """ user_id = yield self.runInteraction( "get_user_id_by_threepid", self.get_user_id_by_threepid_txn, medium, address @@ -481,6 +490,16 @@ class RegistrationStore(RegistrationWorkerStore, defer.returnValue(user_id) def get_user_id_by_threepid_txn(self, txn, medium, address): + """Returns user id from threepid + + Args: + txn (cursor): + medium (str): threepid medium e.g. email + address (str): threepid address e.g. me@example.com + + Returns: + str|None: user id or None if no user id/threepid mapping exists + """ ret = self._simple_select_one_txn( txn, "user_threepids",