From 7862101b1ba058eb161b41c347224c393f02437c Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 2 Dec 2019 23:36:24 +0000 Subject: [PATCH] Fix login ban logic --- houdini/handlers/login/login.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/houdini/handlers/login/login.py b/houdini/handlers/login/login.py index 72b6e13..60171cf 100644 --- a/houdini/handlers/login/login.py +++ b/houdini/handlers/login/login.py @@ -81,7 +81,7 @@ async def handle_login(p, credentials: Credentials): if await data.minutes_played_today >= data.timer_total.total_seconds() // 60: return await p.send_error_and_disconnect(910, data.timer_total) - active_ban = await Ban.query.where(Ban.penguin_id == data.id and Ban.expires >= datetime.now()).gino.first() + active_ban = await Ban.query.where((Ban.penguin_id == data.id) & (Ban.expires >= datetime.now())).gino.first() if active_ban is not None: hours_left = round((active_ban.expires - datetime.now()).total_seconds() / 60 / 60) @@ -89,7 +89,7 @@ async def handle_login(p, credentials: Credentials): if hours_left == 0: return await p.send_error_and_disconnect(602) else: - await p.send_error_and_disconnect(601, hours_left) + return await p.send_error_and_disconnect(601, hours_left) p.logger.info(f'{username} has logged in successfully')