From d25bfe4c981e5503870561910c8f4fb5f9df44a3 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 12 Jun 2020 15:15:29 +0100 Subject: [PATCH] Allow pre-activation trial days to be configured --- bootstrap.py | 2 ++ houdini/handlers/login/login.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bootstrap.py b/bootstrap.py index 5d927c7..46235a4 100644 --- a/bootstrap.py +++ b/bootstrap.py @@ -33,6 +33,8 @@ if __name__ == '__main__': type=int) login_group.add_argument('--login-failure-timer', action='store', default=3600, help='Timeout after flood limit', type=int) + login_group.add_argument('--preactivation-days', action='store', default=7, help='Preactivation trial days', + type=int) login_group.add_argument('-S', '--staff', action='store_true', help='Staff-only server mode') logging_group = parser.add_argument_group('logging') diff --git a/houdini/handlers/login/login.py b/houdini/handlers/login/login.py index f2b858b..d8223fa 100644 --- a/houdini/handlers/login/login.py +++ b/houdini/handlers/login/login.py @@ -64,7 +64,7 @@ async def handle_login(p, credentials: Credentials): preactivation_hours = 0 if not data.active: - preactivation_expiry = data.registration_date + timedelta(days=7) + preactivation_expiry = data.registration_date + timedelta(days=p.server.config.preactivation_days) preactivation_expiry = preactivation_expiry - datetime.now() preactivation_hours = preactivation_expiry.total_seconds() // 3600 if preactivation_hours <= 0 or p.client_type == ClientType.Legacy: