diff options
author | Azrenbeth <7782548+Azrenbeth@users.noreply.github.com> | 2021-08-24 16:42:03 +0100 |
---|---|---|
committer | Azrenbeth <7782548+Azrenbeth@users.noreply.github.com> | 2021-08-24 16:42:03 +0100 |
commit | d9e48a4caa2f146846b79fceb9f3e18a3b8de9ec (patch) | |
tree | f02b38ac524cae21750909f88cc39e88dee5de93 | |
parent | Added (unneccesary?) parentheses to try and make python3.6 happy (diff) | |
download | synapse-d9e48a4caa2f146846b79fceb9f3e18a3b8de9ec.tar.xz |
Don't import saml stuff if saml not enabled
-rw-r--r-- | synapse/server.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/server.py b/synapse/server.py index 4b44e2ea06..63a5f221f4 100644 --- a/synapse/server.py +++ b/synapse/server.py @@ -100,7 +100,6 @@ from synapse.handlers.room_list import RoomListHandler from synapse.handlers.room_member import RoomMemberHandler, RoomMemberMasterHandler from synapse.handlers.room_member_worker import RoomMemberWorkerHandler from synapse.handlers.room_summary import RoomSummaryHandler -from synapse.handlers.saml import Saml2UserMappingProvider from synapse.handlers.search import SearchHandler from synapse.handlers.send_email import SendEmailHandler from synapse.handlers.set_password import SetPasswordHandler @@ -144,7 +143,7 @@ if TYPE_CHECKING: from txredisapi import RedisProtocol from synapse.handlers.oidc import OidcHandler - from synapse.handlers.saml import SamlHandler + from synapse.handlers.saml import Saml2UserMappingProvider, SamlHandler T = TypeVar("T", bound=Callable[..., Any]) @@ -732,6 +731,8 @@ class HomeServer(metaclass=abc.ABCMeta): @cache_in_self def get_saml2_user_mapping_provider(self) -> "Saml2UserMappingProvider": + from synapse.handlers.saml import Saml2UserMappingProvider + return Saml2UserMappingProvider(self) @cache_in_self |