From 5c5189480748ca138f4ff1c0d36dd44ad5777ff2 Mon Sep 17 00:00:00 2001 From: Luna Date: Wed, 13 Mar 2019 04:49:50 -0300 Subject: [PATCH] guilds: add failsafe check for same invite --- litecord/blueprints/guilds.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/litecord/blueprints/guilds.py b/litecord/blueprints/guilds.py index 91cbbef..ffcfc77 100644 --- a/litecord/blueprints/guilds.py +++ b/litecord/blueprints/guilds.py @@ -413,6 +413,9 @@ async def change_vanity_url(guild_id: int): # invites table old_vanity = await _vanity_inv(guild_id) + if old_vanity == inv_code: + raise BadRequest('can not change to same invite') + # this is sad because we don't really use the things # sql gives us, but i havent really found a way to put # multiple ON CONFLICT clauses so we could UPDATE when