From 7d8cc63e374f088b0cb4dfd7d700e04202f4e749 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 19 Jan 2021 14:03:39 -0700 Subject: Get the right requester object --- synapse/rest/admin/rooms.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/synapse/rest/admin/rooms.py b/synapse/rest/admin/rooms.py index 4c0331b197..1d5f6c1807 100644 --- a/synapse/rest/admin/rooms.py +++ b/synapse/rest/admin/rooms.py @@ -308,14 +308,15 @@ class RoomStateRestServlet(RestServlet): async def on_GET( self, request: SynapseRequest, room_id: str ) -> Tuple[int, JsonDict]: - await assert_requester_is_admin(self.auth, request) + requester = await self.auth.get_user_by_req(request) + await assert_user_is_admin(self.auth, requester.user) ret = await self.store.get_room(room_id) if not ret: raise NotFoundError("Room not found") room_state = await self.message_handler.get_state_events( - user_id=request.requester.user.to_string(), + user_id=requester.user.to_string(), room_id=room_id, is_admin=True, # already verified above ) -- cgit 1.4.1