diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2019-08-01 13:54:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-01 13:54:56 +0100 |
commit | 5d018d23f01afe995c435d1d2951a0e7f5b5feb1 (patch) | |
tree | e1c9c2341a9545ade5791e40078f25e54a2ebf56 /synapse | |
parent | Merge pull request #5808 from matrix-org/erikj/parse_decode_error (diff) | |
download | synapse-5d018d23f01afe995c435d1d2951a0e7f5b5feb1.tar.xz |
Have ClientReaderSlavedStore inherit RegistrationStore (#5806)
Fixes #5803
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/storage/registration.py | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py index 999c10a308..55e4e84d71 100644 --- a/synapse/storage/registration.py +++ b/synapse/storage/registration.py @@ -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 |