From 49290da9032386f6563f33bce3cf519d1187b6fa Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Mon, 16 Nov 2020 14:22:54 -0500 Subject: [PATCH] Add some more type hints. --- synapse/handlers/oidc_handler.py | 6 +++--- synapse/handlers/saml_handler.py | 6 +++--- synapse/server.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/synapse/handlers/oidc_handler.py b/synapse/handlers/oidc_handler.py index eddae5071a..be8562d47b 100644 --- a/synapse/handlers/oidc_handler.py +++ b/synapse/handlers/oidc_handler.py @@ -865,11 +865,11 @@ class OidcHandler(BaseHandler): remote_user_id = str(remote_user_id) # first of all, check if we already have a mapping for this user - registered_user_id = await self._sso_handler.get_sso_user_by_remote_user_id( + previously_registered_user_id = await self._sso_handler.get_sso_user_by_remote_user_id( self._auth_provider_id, remote_user_id, ) - if registered_user_id: - return registered_user_id + if previously_registered_user_id: + return previously_registered_user_id # Otherwise, generate a new user. try: diff --git a/synapse/handlers/saml_handler.py b/synapse/handlers/saml_handler.py index e523267d34..aee772239a 100644 --- a/synapse/handlers/saml_handler.py +++ b/synapse/handlers/saml_handler.py @@ -250,11 +250,11 @@ class SamlHandler(BaseHandler): with (await self._mapping_lock.queue(self._auth_provider_id)): # first of all, check if we already have a mapping for this user - registered_user_id = await self._sso_handler.get_sso_user_by_remote_user_id( + previously_registered_user_id = await self._sso_handler.get_sso_user_by_remote_user_id( self._auth_provider_id, remote_user_id, ) - if registered_user_id: - return registered_user_id + if previously_registered_user_id: + return previously_registered_user_id # backwards-compatibility hack: see if there is an existing user with a # suitable mapping from the uid diff --git a/synapse/server.py b/synapse/server.py index d7e0c6e3bf..12a783de17 100644 --- a/synapse/server.py +++ b/synapse/server.py @@ -392,7 +392,7 @@ class HomeServer(metaclass=abc.ABCMeta): return FollowerTypingHandler(self) @cache_in_self - def get_sso_handler(self): + def get_sso_handler(self) -> SsoHandler: return SsoHandler(self) @cache_in_self