forked from MirrorHub/synapse
Have ClientReaderSlavedStore inherit RegistrationStore (#5806)
Fixes #5803
This commit is contained in:
parent
3c076c79c5
commit
5d018d23f0
2 changed files with 22 additions and 21 deletions
1
changelog.d/5806.bugfix
Normal file
1
changelog.d/5806.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Fix error when trying to login as a deactivated user when using a worker to handle login.
|
|
@ -569,6 +569,27 @@ class RegistrationWorkerStore(SQLBaseStore):
|
|||
desc="get_id_servers_user_bound",
|
||||
)
|
||||
|
||||
@cachedInlineCallbacks()
|
||||
def get_user_deactivated_status(self, user_id):
|
||||
"""Retrieve the value for the `deactivated` property for the provided user.
|
||||
|
||||
Args:
|
||||
user_id (str): The ID of the user to retrieve the status for.
|
||||
|
||||
Returns:
|
||||
defer.Deferred(bool): The requested value.
|
||||
"""
|
||||
|
||||
res = yield self._simple_select_one_onecol(
|
||||
table="users",
|
||||
keyvalues={"name": user_id},
|
||||
retcol="deactivated",
|
||||
desc="get_user_deactivated_status",
|
||||
)
|
||||
|
||||
# Convert the integer into a boolean.
|
||||
return res == 1
|
||||
|
||||
|
||||
class RegistrationStore(
|
||||
RegistrationWorkerStore, background_updates.BackgroundUpdateStore
|
||||
|
@ -1317,24 +1338,3 @@ class RegistrationStore(
|
|||
user_id,
|
||||
deactivated,
|
||||
)
|
||||
|
||||
@cachedInlineCallbacks()
|
||||
def get_user_deactivated_status(self, user_id):
|
||||
"""Retrieve the value for the `deactivated` property for the provided user.
|
||||
|
||||
Args:
|
||||
user_id (str): The ID of the user to retrieve the status for.
|
||||
|
||||
Returns:
|
||||
defer.Deferred(bool): The requested value.
|
||||
"""
|
||||
|
||||
res = yield self._simple_select_one_onecol(
|
||||
table="users",
|
||||
keyvalues={"name": user_id},
|
||||
retcol="deactivated",
|
||||
desc="get_user_deactivated_status",
|
||||
)
|
||||
|
||||
# Convert the integer into a boolean.
|
||||
return res == 1
|
||||
|
|
Loading…
Reference in a new issue