FIXUP: linter
This commit is contained in:
parent
93f84e0373
commit
31d072aea0
|
@ -53,7 +53,7 @@ from synapse.types import (
|
||||||
create_requester,
|
create_requester,
|
||||||
)
|
)
|
||||||
from synapse.util import stringutils
|
from synapse.util import stringutils
|
||||||
from synapse.util.async_helpers import Linearizer, maybe_awaitable
|
from synapse.util.async_helpers import Linearizer
|
||||||
from synapse.util.caches.response_cache import ResponseCache
|
from synapse.util.caches.response_cache import ResponseCache
|
||||||
from synapse.util.stringutils import parse_and_validate_server_name
|
from synapse.util.stringutils import parse_and_validate_server_name
|
||||||
from synapse.visibility import filter_events_for_client
|
from synapse.visibility import filter_events_for_client
|
||||||
|
|
|
@ -15,9 +15,11 @@
|
||||||
import logging
|
import logging
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
from typing import TYPE_CHECKING, List, Optional, Tuple
|
from typing import TYPE_CHECKING, List, Optional, Tuple
|
||||||
|
from urllib import parse as urlparse
|
||||||
|
|
||||||
from synapse.api.constants import EventTypes, JoinRules, Membership
|
from synapse.api.constants import EventTypes, JoinRules, Membership
|
||||||
from synapse.api.errors import AuthError, Codes, NotFoundError, SynapseError
|
from synapse.api.errors import AuthError, Codes, NotFoundError, SynapseError
|
||||||
|
from synapse.api.filtering import Filter
|
||||||
from synapse.http.servlet import (
|
from synapse.http.servlet import (
|
||||||
RestServlet,
|
RestServlet,
|
||||||
assert_params_in_dict,
|
assert_params_in_dict,
|
||||||
|
@ -33,6 +35,7 @@ from synapse.rest.admin._base import (
|
||||||
)
|
)
|
||||||
from synapse.storage.databases.main.room import RoomSortOrder
|
from synapse.storage.databases.main.room import RoomSortOrder
|
||||||
from synapse.types import JsonDict, RoomAlias, RoomID, UserID, create_requester
|
from synapse.types import JsonDict, RoomAlias, RoomID, UserID, create_requester
|
||||||
|
from synapse.util import json_decoder
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from synapse.server import HomeServer
|
from synapse.server import HomeServer
|
||||||
|
@ -567,6 +570,7 @@ class ForwardExtremitiesRestServlet(RestServlet):
|
||||||
extremities = await self.store.get_forward_extremities_for_room(room_id)
|
extremities = await self.store.get_forward_extremities_for_room(room_id)
|
||||||
return 200, {"count": len(extremities), "results": extremities}
|
return 200, {"count": len(extremities), "results": extremities}
|
||||||
|
|
||||||
|
|
||||||
class RoomEventContextServlet(RestServlet):
|
class RoomEventContextServlet(RestServlet):
|
||||||
"""
|
"""
|
||||||
Provide the context for an event.
|
Provide the context for an event.
|
||||||
|
@ -574,6 +578,7 @@ class RoomEventContextServlet(RestServlet):
|
||||||
an abuse report and understand what happened during and immediately prior
|
an abuse report and understand what happened during and immediately prior
|
||||||
to this event.
|
to this event.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
PATTERNS = admin_patterns("/rooms/(?P<room_id>[^/]*)/context/(?P<event_id>[^/]*)$")
|
PATTERNS = admin_patterns("/rooms/(?P<room_id>[^/]*)/context/(?P<event_id>[^/]*)$")
|
||||||
|
|
||||||
def __init__(self, hs):
|
def __init__(self, hs):
|
||||||
|
|
|
@ -1461,7 +1461,9 @@ class JoinAliasRoomTestCase(unittest.HomeserverTestCase):
|
||||||
% (room_id, events[midway]["event_id"]),
|
% (room_id, events[midway]["event_id"]),
|
||||||
access_token=tok,
|
access_token=tok,
|
||||||
)
|
)
|
||||||
self.assertEquals(403, int(channel.result["code"]), msg=channel.result["body"])
|
self.assertEquals(
|
||||||
|
403, int(channel.result["code"]), msg=channel.result["body"]
|
||||||
|
)
|
||||||
self.assertEqual(Codes.FORBIDDEN, channel.json_body["errcode"])
|
self.assertEqual(Codes.FORBIDDEN, channel.json_body["errcode"])
|
||||||
|
|
||||||
def test_context_as_admin(self):
|
def test_context_as_admin(self):
|
||||||
|
|
Loading…
Reference in New Issue