relationships: raise RelationshipFailed

this only applies to accounts that are not found.

related to #30
This commit is contained in:
Luna 2018-12-08 18:42:40 -03:00
parent 91dba542df
commit 69493e6912
1 changed files with 5 additions and 1 deletions

View File

@ -126,6 +126,10 @@ async def make_friend(user_id: int, peer_id: int,
return return
class RelationshipFailed(BadRequest):
error_code = 80004
@bp.route('/@me/relationships', methods=['POST']) @bp.route('/@me/relationships', methods=['POST'])
async def post_relationship(): async def post_relationship():
user_id = await token_check() user_id = await token_check()
@ -135,7 +139,7 @@ async def post_relationship():
str(j['discriminator'])) str(j['discriminator']))
if not uid: if not uid:
return '', 404 raise RelationshipFailed()
res = await make_friend(user_id, uid) res = await make_friend(user_id, uid)