From bd26969029147ea8940de98475c2985c78a80df5 Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Mon, 19 Nov 2018 02:26:22 -0300 Subject: [PATCH] blueprints.auth: update instance_invites.uses --- litecord/blueprints/auth.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/litecord/blueprints/auth.py b/litecord/blueprints/auth.py index 04a2cc8..9327f29 100644 --- a/litecord/blueprints/auth.py +++ b/litecord/blueprints/auth.py @@ -68,6 +68,12 @@ async def _register_with_invite(): if row['max_uses'] != -1 and row['uses'] >= row['max_uses']: raise BadRequest('invite expired') + await app.db.execute(""" + UPDATE instance_invites + SET uses = uses + 1 + WHERE code = $1 + """, invcode) + user_id, pwd_hash = await create_user( data['username'], data['email'], data['password'], app.db)