From e24928de9906ecbab5580dafe443b8bdea2e4322 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Thu, 19 Mar 2020 09:46:12 -0400 Subject: [PATCH] Fixes an attribute error when using the default display name during registration. (#32) --- changelog.d/32.bugfix | 1 + synapse/app/client_reader.py | 2 ++ .../slave/storage/user_directory.py | 22 +++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 changelog.d/32.bugfix create mode 100644 synapse/replication/slave/storage/user_directory.py diff --git a/changelog.d/32.bugfix b/changelog.d/32.bugfix new file mode 100644 index 0000000000..b6e7b90710 --- /dev/null +++ b/changelog.d/32.bugfix @@ -0,0 +1 @@ +Fixes a bug when using the default display name during registration. diff --git a/synapse/app/client_reader.py b/synapse/app/client_reader.py index a16e037f32..cd49fc5cd3 100644 --- a/synapse/app/client_reader.py +++ b/synapse/app/client_reader.py @@ -44,6 +44,7 @@ from synapse.replication.slave.storage.receipts import SlavedReceiptsStore from synapse.replication.slave.storage.registration import SlavedRegistrationStore from synapse.replication.slave.storage.room import RoomStore from synapse.replication.slave.storage.transactions import SlavedTransactionStore +from synapse.replication.slave.storage.user_directory import SlavedUserDirectoryStore from synapse.replication.tcp.client import ReplicationClientHandler from synapse.rest.client.v1.login import LoginRestServlet from synapse.rest.client.v1.push_rule import PushRuleRestServlet @@ -84,6 +85,7 @@ class ClientReaderSlavedStore( SlavedTransactionStore, SlavedProfileStore, SlavedClientIpStore, + SlavedUserDirectoryStore, BaseSlavedStore, ): pass diff --git a/synapse/replication/slave/storage/user_directory.py b/synapse/replication/slave/storage/user_directory.py new file mode 100644 index 0000000000..0d7b1a4a83 --- /dev/null +++ b/synapse/replication/slave/storage/user_directory.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 The Matrix.org Foundation C.I.C. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from synapse.storage.user_directory import UserDirectoryStore + +from ._base import BaseSlavedStore + + +class SlavedUserDirectoryStore(UserDirectoryStore, BaseSlavedStore): + pass