diff options
author | reivilibre <oliverw@matrix.org> | 2021-12-02 15:30:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-02 15:30:05 +0000 |
commit | 435f04480728c5d982e1a63c1b2777784bf9cd26 (patch) | |
tree | 1739f511566d586e12cfacb521eab9dd6e0506bd /synapse/storage/databases | |
parent | `scripts-dev/sign_json`: support for signing events (#11486) (diff) | |
download | synapse-435f04480728c5d982e1a63c1b2777784bf9cd26.tar.xz |
Add type annotations to `tests.storage.test_appservice`. (#11488)
Diffstat (limited to 'synapse/storage/databases')
-rw-r--r-- | synapse/storage/databases/main/appservice.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/storage/databases/main/appservice.py b/synapse/storage/databases/main/appservice.py index baec35ee27..4a883dc166 100644 --- a/synapse/storage/databases/main/appservice.py +++ b/synapse/storage/databases/main/appservice.py @@ -143,7 +143,7 @@ class ApplicationServiceTransactionWorkerStore( A list of ApplicationServices, which may be empty. """ results = await self.db_pool.simple_select_list( - "application_services_state", {"state": state}, ["as_id"] + "application_services_state", {"state": state.value}, ["as_id"] ) # NB: This assumes this class is linked with ApplicationServiceStore as_list = self.get_app_services() @@ -173,7 +173,7 @@ class ApplicationServiceTransactionWorkerStore( desc="get_appservice_state", ) if result: - return result.get("state") + return ApplicationServiceState(result.get("state")) return None async def set_appservice_state( @@ -186,7 +186,7 @@ class ApplicationServiceTransactionWorkerStore( state: The connectivity state to apply. """ await self.db_pool.simple_upsert( - "application_services_state", {"as_id": service.id}, {"state": state} + "application_services_state", {"as_id": service.id}, {"state": state.value} ) async def create_appservice_txn( |