diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2023-10-31 13:13:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-31 13:13:28 -0400 |
commit | cfb6d38c47711b8dfaf0125353aec88d16708b97 (patch) | |
tree | 5376fba887e841c9574b5ee444719560e5c47135 /synapse/rest/admin/rooms.py | |
parent | Merge branch 'release-v1.96' into develop (diff) | |
download | synapse-cfb6d38c47711b8dfaf0125353aec88d16708b97.tar.xz |
Remove remaining usage of cursor_to_dict. (#16564)
Diffstat (limited to 'synapse/rest/admin/rooms.py')
-rw-r--r-- | synapse/rest/admin/rooms.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/synapse/rest/admin/rooms.py b/synapse/rest/admin/rooms.py index 0659f22a89..23a034522c 100644 --- a/synapse/rest/admin/rooms.py +++ b/synapse/rest/admin/rooms.py @@ -16,6 +16,8 @@ from http import HTTPStatus from typing import TYPE_CHECKING, List, Optional, Tuple, cast from urllib import parse as urlparse +import attr + from synapse.api.constants import Direction, EventTypes, JoinRules, Membership from synapse.api.errors import AuthError, Codes, NotFoundError, SynapseError from synapse.api.filtering import Filter @@ -306,10 +308,13 @@ class RoomRestServlet(RestServlet): raise NotFoundError("Room not found") members = await self.store.get_users_in_room(room_id) - ret["joined_local_devices"] = await self.store.count_devices_by_users(members) - ret["forgotten"] = await self.store.is_locally_forgotten_room(room_id) + result = attr.asdict(ret) + result["joined_local_devices"] = await self.store.count_devices_by_users( + members + ) + result["forgotten"] = await self.store.is_locally_forgotten_room(room_id) - return HTTPStatus.OK, ret + return HTTPStatus.OK, result async def on_DELETE( self, request: SynapseRequest, room_id: str |