invites: return 404 on unknown inv

This commit is contained in:
Luna Mendes 2018-11-20 13:42:00 -03:00
parent 48a65325f4
commit c33be64b79
1 changed files with 3 additions and 0 deletions

View File

@ -51,6 +51,9 @@ async def create_invite(channel_id):
async def get_invite(invite_code: str):
inv = await app.storage.get_invite(invite_code)
if not inv:
return '', 404
if request.args.get('with_counts'):
extra = await app.storage.get_invite_extra(invite_code)
inv.update(extra)