mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 01:04:49 -04:00
Run Black. (#5482)
This commit is contained in:
parent
7dcf984075
commit
32e7c9e7f2
376 changed files with 9142 additions and 10388 deletions
|
@ -56,8 +56,9 @@ class ClientDirectoryServer(RestServlet):
|
|||
|
||||
content = parse_json_object_from_request(request)
|
||||
if "room_id" not in content:
|
||||
raise SynapseError(400, 'Missing params: ["room_id"]',
|
||||
errcode=Codes.BAD_JSON)
|
||||
raise SynapseError(
|
||||
400, 'Missing params: ["room_id"]', errcode=Codes.BAD_JSON
|
||||
)
|
||||
|
||||
logger.debug("Got content: %s", content)
|
||||
logger.debug("Got room name: %s", room_alias.to_string())
|
||||
|
@ -89,13 +90,11 @@ class ClientDirectoryServer(RestServlet):
|
|||
try:
|
||||
service = yield self.auth.get_appservice_by_req(request)
|
||||
room_alias = RoomAlias.from_string(room_alias)
|
||||
yield dir_handler.delete_appservice_association(
|
||||
service, room_alias
|
||||
)
|
||||
yield dir_handler.delete_appservice_association(service, room_alias)
|
||||
logger.info(
|
||||
"Application service at %s deleted alias %s",
|
||||
service.url,
|
||||
room_alias.to_string()
|
||||
room_alias.to_string(),
|
||||
)
|
||||
defer.returnValue((200, {}))
|
||||
except AuthError:
|
||||
|
@ -107,14 +106,10 @@ class ClientDirectoryServer(RestServlet):
|
|||
|
||||
room_alias = RoomAlias.from_string(room_alias)
|
||||
|
||||
yield dir_handler.delete_association(
|
||||
requester, room_alias
|
||||
)
|
||||
yield dir_handler.delete_association(requester, room_alias)
|
||||
|
||||
logger.info(
|
||||
"User %s deleted alias %s",
|
||||
user.to_string(),
|
||||
room_alias.to_string()
|
||||
"User %s deleted alias %s", user.to_string(), room_alias.to_string()
|
||||
)
|
||||
|
||||
defer.returnValue((200, {}))
|
||||
|
@ -135,9 +130,9 @@ class ClientDirectoryListServer(RestServlet):
|
|||
if room is None:
|
||||
raise NotFoundError("Unknown room")
|
||||
|
||||
defer.returnValue((200, {
|
||||
"visibility": "public" if room["is_public"] else "private"
|
||||
}))
|
||||
defer.returnValue(
|
||||
(200, {"visibility": "public" if room["is_public"] else "private"})
|
||||
)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def on_PUT(self, request, room_id):
|
||||
|
@ -147,7 +142,7 @@ class ClientDirectoryListServer(RestServlet):
|
|||
visibility = content.get("visibility", "public")
|
||||
|
||||
yield self.handlers.directory_handler.edit_published_room_list(
|
||||
requester, room_id, visibility,
|
||||
requester, room_id, visibility
|
||||
)
|
||||
|
||||
defer.returnValue((200, {}))
|
||||
|
@ -157,7 +152,7 @@ class ClientDirectoryListServer(RestServlet):
|
|||
requester = yield self.auth.get_user_by_req(request)
|
||||
|
||||
yield self.handlers.directory_handler.edit_published_room_list(
|
||||
requester, room_id, "private",
|
||||
requester, room_id, "private"
|
||||
)
|
||||
|
||||
defer.returnValue((200, {}))
|
||||
|
@ -191,7 +186,7 @@ class ClientAppserviceDirectoryListServer(RestServlet):
|
|||
)
|
||||
|
||||
yield self.handlers.directory_handler.edit_published_appservice_room_list(
|
||||
requester.app_service.id, network_id, room_id, visibility,
|
||||
requester.app_service.id, network_id, room_id, visibility
|
||||
)
|
||||
|
||||
defer.returnValue((200, {}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue