From 6763f2c501d40bbb1ad117f6c36d0ee33698e959 Mon Sep 17 00:00:00 2001 From: Luna Date: Wed, 13 Mar 2019 05:04:48 -0300 Subject: [PATCH] guilds: add VANITY_URL feature check when editing vanity --- litecord/blueprints/guilds.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/litecord/blueprints/guilds.py b/litecord/blueprints/guilds.py index 8d2b669..4c94953 100644 --- a/litecord/blueprints/guilds.py +++ b/litecord/blueprints/guilds.py @@ -403,6 +403,11 @@ async def get_vanity_url(guild_id: int): async def change_vanity_url(guild_id: int): """Get the vanity url of a guild.""" user_id = await token_check() + + if not await app.storage.has_feature(guild_id, 'VANITY_URL'): + # TODO: is this the right error + raise BadRequest('guild has no vanity url support') + await guild_perm_check(user_id, guild_id, 'manage_guild') j = validate(await request.get_json(), VANITY_URL_PATCH)