mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-25 22:29:24 -05:00
Have ClientReaderSlavedStore inherit RegistrationStore (#5806)
Fixes #5803
This commit is contained in:
parent
3c076c79c5
commit
5d018d23f0
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",
|
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(
|
class RegistrationStore(
|
||||||
RegistrationWorkerStore, background_updates.BackgroundUpdateStore
|
RegistrationWorkerStore, background_updates.BackgroundUpdateStore
|
||||||
@ -1317,24 +1338,3 @@ class RegistrationStore(
|
|||||||
user_id,
|
user_id,
|
||||||
deactivated,
|
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 New Issue
Block a user