Merge branch 'patch-2' into 'master'

Prevent ability to add yourself as a friend

See merge request litecord/litecord!65
This commit is contained in:
Luna 2020-08-03 00:24:30 +00:00
commit 3dc289d90f
1 changed files with 3 additions and 0 deletions

View File

@ -228,6 +228,9 @@ async def post_relationship():
if not uid: if not uid:
raise RelationshipFailed("No users with DiscordTag exist") raise RelationshipFailed("No users with DiscordTag exist")
if uid == user_id:
raise RelationshipFailed("Tried to add themselves as friend")
res = await make_friend(user_id, uid) res = await make_friend(user_id, uid)
if res is None: if res is None: