black fmt pass

This commit is contained in:
Luna 2020-03-31 16:34:41 -03:00
parent d0f1729fd6
commit 29091293f5
6 changed files with 33 additions and 10 deletions

View File

@ -179,4 +179,3 @@ async def _del_emoji(guild_id, emoji_id):
await _dispatch_emojis(guild_id)
return "", 204

View File

@ -311,4 +311,3 @@ async def delete_guild_role(guild_id, role_id):
)
return "", 204

View File

@ -302,7 +302,7 @@ async def _update_guild(guild_id):
raise BadRequest("guild does not have PUBLIC feature")
await _guild_update_icon("discovery_splash", guild_id, j["discovery_splash"])
fields = [
"verification_level",
"default_message_notifications",
@ -323,7 +323,12 @@ async def _update_guild(guild_id):
guild_id,
)
channel_fields = ["afk_channel_id", "system_channel_id", "rules_channel_id", "public_updates_channel_id"]
channel_fields = [
"afk_channel_id",
"system_channel_id",
"rules_channel_id",
"public_updates_channel_id",
]
for field in [f for f in channel_fields if f in j]:
# setting to null should remove the link between the afk/sys/rules/public updates channel
# to the guild.

View File

@ -109,7 +109,8 @@ async def _get_guild_banner(guild_id: int, icon_file: str):
icon_hash, ext = splitext_(icon_file)
return await send_icon("banner", guild_id, icon_hash, ext=ext)
@bp.route("/discovery-splashes/<int:guild_id>/<icon_file>", methods=["GET"])
async def _get_discovery_splash(guild_id: int, icon_file: str):
icon_hash, ext = splitext_(icon_file)
return await send_icon("discovery_splash", guild_id, icon_hash, ext=ext)
return await send_icon("discovery_splash", guild_id, icon_hash, ext=ext)

View File

@ -528,4 +528,3 @@ class IconManager:
await self.delete(old_icon)
return await self.put(scope, key, new_icon_data, **kwargs)

View File

@ -287,13 +287,33 @@ GUILD_UPDATE = {
"verification_level": {"type": "verification_level", "required": False},
"default_message_notifications": {"type": "msg_notifications", "required": False},
"explicit_content_filter": {"type": "explicit", "required": False},
"afk_channel_id": {"type": "snowflake", "coerce": int, "required": False, "nullable": True},
"afk_channel_id": {
"type": "snowflake",
"coerce": int,
"required": False,
"nullable": True,
},
"afk_timeout": {"type": "number", "required": False},
"owner_id": {"type": "snowflake", "coerce": int, "required": False},
"system_channel_id": {"type": "snowflake", "coerce": int, "required": False, "nullable": True},
"system_channel_id": {
"type": "snowflake",
"coerce": int,
"required": False,
"nullable": True,
},
"features": {"type": "list", "required": False, "schema": {"type": "string"}},
"rules_channel_id": {"type": "snowflake", "coerce": int, "required": False, "nullable": True},
"public_updates_channel_id": {"type": "snowflake", "coerce": int, "required": False, "nullable": True},
"rules_channel_id": {
"type": "snowflake",
"coerce": int,
"required": False,
"nullable": True,
},
"public_updates_channel_id": {
"type": "snowflake",
"coerce": int,
"required": False,
"nullable": True,
},
"preferred_locale": {"type": "string", "required": False, "nullable": True},
"discovery_splash": {"type": "string", "required": False, "nullable": True},
}