Skip to content
Snippets Groups Projects
Unverified Commit 5b2b3680 authored by Richard van der Hoff's avatar Richard van der Hoff Committed by GitHub
Browse files

Remove more references to `get_datastore` (#12067)

These have snuck in since #12031 was started.

Also a couple of other cleanups while we're in the area.
parent e24ff8eb
No related branches found
No related tags found
No related merge requests found
Implement experimental support for [MSC3720](https://github.com/matrix-org/matrix-doc/pull/3720) (account status endpoints).
...@@ -23,7 +23,7 @@ if TYPE_CHECKING: ...@@ -23,7 +23,7 @@ if TYPE_CHECKING:
class AccountHandler: class AccountHandler:
def __init__(self, hs: "HomeServer"): def __init__(self, hs: "HomeServer"):
self._store = hs.get_datastore() self._main_store = hs.get_datastores().main
self._is_mine = hs.is_mine self._is_mine = hs.is_mine
self._federation_client = hs.get_federation_client() self._federation_client = hs.get_federation_client()
...@@ -98,7 +98,7 @@ class AccountHandler: ...@@ -98,7 +98,7 @@ class AccountHandler:
""" """
status = {"exists": False} status = {"exists": False}
userinfo = await self._store.get_userinfo_by_id(user_id.to_string()) userinfo = await self._main_store.get_userinfo_by_id(user_id.to_string())
if userinfo is not None: if userinfo is not None:
status = { status = {
......
...@@ -904,9 +904,6 @@ class AccountStatusRestServlet(RestServlet): ...@@ -904,9 +904,6 @@ class AccountStatusRestServlet(RestServlet):
def __init__(self, hs: "HomeServer"): def __init__(self, hs: "HomeServer"):
super().__init__() super().__init__()
self._auth = hs.get_auth() self._auth = hs.get_auth()
self._store = hs.get_datastore()
self._is_mine = hs.is_mine
self._federation_client = hs.get_federation_client()
self._account_handler = hs.get_account_handler() self._account_handler = hs.get_account_handler()
async def on_POST(self, request: SynapseRequest) -> Tuple[int, JsonDict]: async def on_POST(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
......
...@@ -1119,7 +1119,9 @@ class AccountStatusTestCase(unittest.HomeserverTestCase): ...@@ -1119,7 +1119,9 @@ class AccountStatusTestCase(unittest.HomeserverTestCase):
"""Tests that the account status endpoint correctly reports a deactivated user.""" """Tests that the account status endpoint correctly reports a deactivated user."""
user = self.register_user("someuser", "password") user = self.register_user("someuser", "password")
self.get_success( self.get_success(
self.hs.get_datastore().set_user_deactivated_status(user, deactivated=True) self.hs.get_datastores().main.set_user_deactivated_status(
user, deactivated=True
)
) )
self._test_status( self._test_status(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment